Is the clone
necessary in example for clippy::needless_collect
?
#10784
-
The example for clippy::needless_collect is written as follows: let len = iterator.clone().collect::<Vec<_>>().len();
// should be
let len = iterator.count(); I have a feeling the the
Is this the case and should I open up a PR for this? |
Beta Was this translation helpful? Give feedback.
Answered by
Alexendoo
May 15, 2023
Replies: 2 comments 1 reply
-
Yeah it isn't needed, I'd go with the second option 👍 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mickvangelderen
-
Opened #10786 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah it isn't needed, I'd go with the second option 👍