string_to_string does not trigger inside a map function #14175
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
If you try to use String::to_string in a map function on an option, the lint does not trigger.
See the example below
Lint Name
string_to_string
Reproducer
I tried this code:
I expected to see this happen:
That
let variable3 = variable2.map(String::to_string);
should be changed tolet variable3 = variable2.cloned();
Instead, this happened:
nothing
Version
The text was updated successfully, but these errors were encountered: