mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-17 10:18:20 +00:00
22 lines
888 B
Text
22 lines
888 B
Text
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
|
|
--> $DIR/iter_nth_zero.rs:20:14
|
|
|
|
|
LL | let _x = s.iter().nth(0);
|
|
| ^^^^^^^^^^^^^^^ 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
|
|
--> $DIR/iter_nth_zero.rs:25:14
|
|
|
|
|
LL | let _y = iter.nth(0);
|
|
| ^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `iter.next()`
|
|
|
|
error: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
|
|
--> $DIR/iter_nth_zero.rs:30:22
|
|
|
|
|
LL | let _unwrapped = iter2.nth(0).unwrap();
|
|
| ^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `iter2.next()`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|