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
fix: incorrect suggestions when .then
and .then_some
is used
#12094
Conversation
r? @Manishearth (rustbot has picked a reviewer for you, use r? to override) |
186c032
to
a74b4b9
Compare
☔ The latest upstream changes (presumably #12140) made this pull request unmergeable. Please resolve the merge conflicts. |
4cb21b0
to
64a07ad
Compare
Manish is currently pretty busy @ARandomDev99, would you mind giving this a prereview? |
This PR is on my todo list for this week. @ARandomDev99 thank you for the review ❤️ |
This implementation looks good to me. I like the idea of @Manishearth to have a general util method for this, but that is out of the scope of this PR IMO. Also, since it has been open for such a long time, I'll merge it as is, since the implementation looks good. Thank you for the fix! :D Let's see if the CI still passes. @bors r=xFrednet,ARandomDev99 |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #11910
In the current implementation of
search_is_some
, if a.is_none
call is followed by a.then
or.then_some
call, the generated!
will incorrectly negate the values returned by thethen
and.then_some
calls. To fix this, we need to add parentheses to the generated suggestions when appropriate.changelog: [
search_is_some
]: add parenthesis to suggestions when appropriate