-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement unnecesary_filter_map lint #3223
Conversation
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.
Apart from separating the code, LGTM ✨
tests/ui/methods.rs
Outdated
@@ -443,3 +443,17 @@ fn main() { | |||
let opt = Some(0); | |||
let _ = opt.unwrap(); | |||
} | |||
|
|||
/// Checks implementation of `UNNECESSARY_FILTER_MAP` lint |
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.
It would be nice to move these tests to their own tests/ui/unnecessary_filter_map.rs
file so that the UI diffs are smaller. (#2038)
clippy_lints/src/methods.rs
Outdated
@@ -1398,6 +1424,144 @@ fn lint_unnecessary_fold(cx: &LateContext<'_, '_>, expr: &hir::Expr, fold_args: | |||
}; | |||
} | |||
|
|||
mod unnecessary_filter_map { |
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.
Do you think it's possible to move this to its own file? methods.rs
is already quite large.
I totally broke the update_lints.py when I changed the modules. Please don't merge until I fix. |
It's done. |
Thanks! |
No description provided.