summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/default_instead_of_iter_empty.txt
blob: b63ef3d18fc411d16f22e1f70f801b50d87a443f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
It checks for `std::iter::Empty::default()` and suggests replacing it with
`std::iter::empty()`.
### Why is this bad?
`std::iter::empty()` is the more idiomatic way.
### Example
```
let _ = std::iter::Empty::<usize>::default();
let iter: std::iter::Empty<usize> = std::iter::Empty::default();
```
Use instead:
```
let _ = std::iter::empty::<usize>();
let iter: std::iter::Empty<usize> = std::iter::empty();
```