-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: remove unnecessary filter_map usages #13548
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: remove unnecessary filter_map usages #13548
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
The suggestion can be shortened, otherwise this looks good.
cx, | ||
if name == "filter_map" { | ||
UNNECESSARY_FILTER_MAP | ||
} else { | ||
UNNECESSARY_FIND_MAP | ||
}, | ||
expr.span, | ||
format!("this `.{name}` can be written more simply using `.{sugg}`"), | ||
format!("this `.{name}` can be written more simply"), | ||
format!("try replacing with `.{sugg}`"), |
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.
This doubles the suggestion in the output. Please reduce the text to "try instead" or "replace with".
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.
@llogiq fixed, thanks!
@rustbot ready |
Thank you! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #12556
(Fixed version of #12766)
changelog: [unnecessary_filter_map]: filter map improvements