suggest .into_iter() when trying to collect Vec<T> into Vec<T> #82848
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.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
Instead of somehow trying to call
.clone()
on the Strings, ifv
is not used anywhere else, one can easily fix this problem by callingv2 .. = v.into_iter()
instead ofv2 .. = v.iter()
.Does it make sense for rustc to suggest that?
The text was updated successfully, but these errors were encountered: