summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/skip_while_next.txt
blob: 1ec8a3a28d5b03c1f8aa110be33b077a4605a17a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### What it does
Checks for usage of `_.skip_while(condition).next()`.

### Why is this bad?
Readability, this can be written more concisely as
`_.find(!condition)`.

### Example
```
vec.iter().skip_while(|x| **x == 0).next();
```

Use instead:
```
vec.iter().find(|x| **x != 0);
```