rust-clippy/tests/ui/iter_nth_zero.stderr

23 lines
888 B
Text
Raw Normal View History

error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
2023-07-27 11:40:22 +00:00
--> $DIR/iter_nth_zero.rs:18:14
|
LL | let _x = s.iter().nth(0);
2020-07-14 16:20:19 +00:00
| ^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.iter().next()`
|
= note: `-D clippy::iter-nth-zero` implied by `-D warnings`
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
2023-07-27 11:40:22 +00:00
--> $DIR/iter_nth_zero.rs:23:14
|
LL | let _y = iter.nth(0);
2020-07-14 16:20:19 +00:00
| ^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `iter.next()`
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
2023-07-27 11:40:22 +00:00
--> $DIR/iter_nth_zero.rs:28:22
|
LL | let _unwrapped = iter2.nth(0).unwrap();
2020-07-14 16:20:19 +00:00
| ^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `iter2.next()`
error: aborting due to 3 previous errors