mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
0c54913afe
This was previously duplicated in #3605
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
|
|
--> $DIR/iter_skip_next.rs:18:13
|
|
|
|
|
LL | let _ = some_vec.iter().skip(42).next();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
|
|
|
|
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
|
|
--> $DIR/iter_skip_next.rs:19:13
|
|
|
|
|
LL | let _ = some_vec.iter().cycle().skip(42).next();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
|
|
--> $DIR/iter_skip_next.rs:20:13
|
|
|
|
|
LL | let _ = (1..10).skip(10).next();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
|
|
--> $DIR/iter_skip_next.rs:21:14
|
|
|
|
|
LL | let _ = &some_vec[..].iter().skip(3).next();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 4 previous errors
|
|
|