filter_map_identity
FN on &Option
and other non-identity functions
#12501
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
Summary
While it's technically not an identity function,
|&x| x
and||x| x.as_ref()|
should be linted for the same reasons as|x| x
Lint Name
clippy::filter_map_identity
Reproducer
I tried this code:
I expected to see this happen: 4 warnings
Instead, this happened: clippy is silent
Version
The text was updated successfully, but these errors were encountered: