-
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
Add unnecessary_find_map
lint
#8489
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
tests/ui/unnecessary_filter_map.rs
Outdated
@@ -2,26 +2,43 @@ | |||
|
|||
fn main() { | |||
let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None }); | |||
let _ = (0..4).find_map(|x| if x > 1 { Some(x) } else { None }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you factor those tests out into their own ui test file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
c38fe51
to
6ff12f8
Compare
6ff12f8
to
2a588d8
Compare
Thank you! @bors r+ |
📌 Commit 2a588d8 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR adds an
unnecessary_find_map
lint. It is essentially just a minor enhancement ofunnecessary_filter_map
.Closes #8467
changelog: New lint
unnecessary_find_map