Option::map(_).flatten() => Option::and_then(_) #5175
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
L-complexity
Lint: Belongs in the complexity lint group
The
map_flatten
lint seems to only apply to iterators:rust-clippy/clippy_lints/src/methods/mod.rs
Lines 406 to 422 in 41d90d3
For
Option
, map + flatten can be replaced with and_then.see for example this code:
which can be more succinctly written as:
The text was updated successfully, but these errors were encountered: