mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
9cd483d5c9
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: https://github.com/rust-lang/rust-clippy/discussions/10784#discussion-5198885 changelog: [`needless_collect`]: Cleaned up the example in the lint documentation. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |