-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Use Into<Option<_>>
in argument position where applicable
#1590
base: main
Are you sure you want to change the base?
Conversation
b20f195
to
1bc9868
Compare
We did that (or something very similar) at some point but then reverted it again because it made it hard to use in cases where there would be multiple possible trait impls, and the compiler errors were not very helpful. Is this not a concern anymore or does this only cover the clear cases? |
In my tests so far, I only encountered rare cases such as the one fixed in 8c09634, in response to the following error:
|
Hm, why not and should we maybe add that? :)
Can you highlight the others ones in the different PRs/MRs together with the compiler error? |
Take a look at this playground for an illustration. AIUI, the problem is not really that
In the 3 main repositories, that was the error from above and a couple of call sites in the gtk4 examples. I pushed a Edit: there is also the last commit of this PR ("pango: manual impl for some functions ", see commit message for details), but that's not something that affects users. Edit2: note that I didn't implement Edit 3: updated the cases which needed an updated (missed gtk4 examples). |
1bc9868
to
8664b84
Compare
Functions `itemize()` & `itemize_with_base_dir` now use Into<Option<&_>> for the `cached_dir` argument. Because of this new signature, the lifetime for the inner type `AttrIterator<'_>>` must be specified.
Functions `itemize()` & `itemize_with_base_dir` now use Into<Option<&_>> for the `cached_dir` argument. Because of this new signature, the lifetime for the inner type `AttrIterator<'_>>` must be specified.
8664b84
to
8a8eb65
Compare
That These are all cases of One concern I have is that people might do Otherwise this seems fine. The same problem with @bilelmoussaoui Do you have opinions on this? |
I agree this case is suboptimal. Now that the generator implementation has settled down, I can take some time to figure out if something could improve this use case. Worse case scenario, we could remove support for |
Considering the minimal amount of changes you had to do and it only affecting strings, I'm not sure keeping it like this is really a problem. |
See the gir PR for details.
TODO