Detect AString.clone()
when &str
is needed and emit appropriate suggestion
#61106
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
On type mismatch with a suggestion to borrow in order to dereference a
String
into a&str
, we should notice unnecessary.clone()
calls:and suggest their removal:
From https://thenewwazoo.github.io/clone.html
The text was updated successfully, but these errors were encountered: