.as_ref().map(|x| *x)
is no longer warned
#12142
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
We used to lint on
Some(1).as_ref().map(|x| *x)
, but no longer do. The interaction between the two lintsuseless_asref
andmap_clone
is important here.Some more context (where this was found and probably for why this is): #12136 (comment).
Lint Name
map_clone
/useless_asref
Reproducer
I tried this code:
I expected to see this happen:
Instead, this happened:
no warnings
Version
The text was updated successfully, but these errors were encountered: