summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/range_zip_with_len.txt
blob: 24c1efec789a98c093a44a42b789b744d2a94b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### What it does
Checks for zipping a collection with the range of
`0.._.len()`.

### Why is this bad?
The code is better expressed with `.enumerate()`.

### Example
```
let _ = x.iter().zip(0..x.len());
```

Use instead:
```
let _ = x.iter().enumerate();
```