]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/range_zip_with_len.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / range_zip_with_len.txt
1 ### What it does
2 Checks for zipping a collection with the range of
3 `0.._.len()`.
4
5 ### Why is this bad?
6 The code is better expressed with `.enumerate()`.
7
8 ### Example
9 ```
10 let _ = x.iter().zip(0..x.len());
11 ```
12
13 Use instead:
14 ```
15 let _ = x.iter().enumerate();
16 ```