-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Detect .map_or(false, f)
in manual_is_variant_and
lint
#13509
Detect .map_or(false, f)
in manual_is_variant_and
lint
#13509
Conversation
r? @Manishearth rustbot has assigned @Manishearth. Use |
FWIW, this is also being implemented in #11796, though as a new lint and not part of |
Oh. So what do we do? Although I think this check rather belongs to |
Moreover, @Jacherr PR could be retargeted to catch instances of |
The existing PR is pretty far through the review process and as far as I know just needs a few more changes before being ready for merging. I just need time to get round to it! As is, I’m not sure there’s much benefit complicating the situation even further with that PR because it’s been open for almost a year now (oops..) As for these improvements, they can probably be retroactively applied after the fact (either by myself or you). |
Fine with me, I'll keep this PR in my own version for the time being so that I can benefit from the lint (I detected some usages of |
On vacation for a week. Feel free to retarget review with |
.map_or(false, f)
on aOption
or aResult
was not detected bymanual_is_variant_and
.This change is small (first commit), but induces a lot of (rightful) fixes (second commit) in Clippy sources.
changelog: [
manual_is_variant_and
]: add detection of.map_or(false, f)
pattern