Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#10786 - mickvangelderen:remove-unnecessary-cl…
…one-from-needless-collect-example, r=Alexendoo Remove unnecessary `clone` from `needless_collect` example The example for [clippy::needless_collect](https://rust-lang.github.io/rust-clippy/master/#needless_collect) is written as follows: ```rust let len = iterator.clone().collect::<Vec<_>>().len(); // should be let len = iterator.count(); ``` With this change, the unnecessary `clone()` is removed and the the standard ### Example ```rust // original ``` Use instead: ```rust // improved ``` structure is followed. Discussion: rust-lang/rust-clippy#10784 (comment) changelog: [`needless_collect`]: Cleaned up the example in the lint documentation.
- Loading branch information