map_flatten
could suggest filter(matches!())
in case of map( match { _ => Option }).flatten()
#12644
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
L-suggestion
Lint: Improving, adding or fixing lint suggestions
Description
I hope this not too convoluted 馃槄
I came across some code like
clippy already recognizes the pattern and
filter_map
fires:but, I believe it would be more elegant to completely forgo the "map" as well as the "match" by using
filter(.. matches!())
in case we find ourselves matching on a pattern:Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: