map_flatten does not cover Result.map #7496
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Lint name:
map_flatten
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3c1eced0e47dac7f563945134ddc3bc8
I expected to see this happen:
This should fall under lint rule
map_flatten
.The lint should advise the user to use
andThen
, instead of the.map(..).flatten()
Instead, this happened:
Result is not currently covered by the lint rule.
However, it is nearly the same as Option's map_flatten, and therefore makes sense to be included.
Meta
cargo clippy -V
: e.g. clippy 0.1.53 (53cb7b09 2021-06-17)-- Although I did run
rustup update
, I'm not sure if this is the latest dev version, but the lint rule doesn't seem to have changed in any recent versions.rustc -Vv
:The text was updated successfully, but these errors were encountered: