]> git.lizzy.rs Git - rust.git/blob - src/docs/infinite_iter.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / infinite_iter.txt
1 ### What it does
2 Checks for iteration that is guaranteed to be infinite.
3
4 ### Why is this bad?
5 While there may be places where this is acceptable
6 (e.g., in event streams), in most cases this is simply an error.
7
8 ### Example
9 ```
10 use std::iter;
11
12 iter::repeat(1_u8).collect::<Vec<_>>();
13 ```