]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/iter_next_slice.txt
Rollup merge of #99578 - steffahn:remove_redundant_bound, r=thomcc
[rust.git] / src / tools / clippy / src / docs / iter_next_slice.txt
1 ### What it does
2 Checks for usage of `iter().next()` on a Slice or an Array
3
4 ### Why is this bad?
5 These can be shortened into `.get()`
6
7 ### Example
8 ```
9 a[2..].iter().next();
10 b.iter().next();
11 ```
12 should be written as:
13 ```
14 a.get(2);
15 b.get(0);
16 ```