diff options
| author | bors <bors@rust-lang.org> | 2023-05-18 02:11:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-18 02:11:02 +0000 |
| commit | 9cd483d5c915893dd675e43dc2c9945d513313bb (patch) | |
| tree | 3864fee2aad959a4589bce2fc532c7914226b07d /tests/rustdoc-js-std/parser-errors.js | |
| parent | f3f6fd8920549107bd7506b35d445996840027e9 (diff) | |
| parent | 79eb06c6ec8838f6929ee54681de346f1b6bbde4 (diff) | |
| download | rust-9cd483d5c915893dd675e43dc2c9945d513313bb.tar.gz rust-9cd483d5c915893dd675e43dc2c9945d513313bb.zip | |
Auto merge of #10786 - mickvangelderen:remove-unnecessary-clone-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: https://github.com/rust-lang/rust-clippy/discussions/10784#discussion-5198885
changelog: [`needless_collect`]: Cleaned up the example in the lint documentation.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
