summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/iter_next_slice.txt
blob: 1cea25eaf3017a7d5f6b8024ac886cad194182e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### What it does
Checks for usage of `iter().next()` on a Slice or an Array

### Why is this bad?
These can be shortened into `.get()`

### Example
```
a[2..].iter().next();
b.iter().next();
```
should be written as:
```
a.get(2);
b.get(0);
```