2020-11-05 14:29:48 +01:00
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:17:28
|
2018-12-30 12:41:37 +01:00
|
|
|
|
|
|
|
|
LL | let _ = some_vec.iter().skip(42).next();
|
2020-08-11 15:43:21 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(42)`
|
2018-12-30 12:41:37 +01:00
|
|
|
|
|
|
|
|
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::iter_skip_next)]`
|
2018-12-30 12:41:37 +01:00
|
|
|
|
2020-11-05 14:29:48 +01:00
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:18:36
|
2018-12-30 12:41:37 +01:00
|
|
|
|
|
|
|
|
LL | let _ = some_vec.iter().cycle().skip(42).next();
|
2020-08-11 15:43:21 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(42)`
|
2018-12-30 12:41:37 +01:00
|
|
|
|
2020-11-05 14:29:48 +01:00
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:19:20
|
2018-12-30 12:41:37 +01:00
|
|
|
|
|
|
|
|
LL | let _ = (1..10).skip(10).next();
|
2020-08-11 15:43:21 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(10)`
|
2018-12-30 12:41:37 +01:00
|
|
|
|
2020-11-05 14:29:48 +01:00
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:20:33
|
2018-12-30 12:41:37 +01:00
|
|
|
|
|
|
|
|
LL | let _ = &some_vec[..].iter().skip(3).next();
|
2020-08-11 15:43:21 +02:00
|
|
|
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(3)`
|
2018-12-30 12:41:37 +01:00
|
|
|
|
2021-12-30 15:10:43 +01:00
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:28:26
|
2021-12-30 15:10:43 +01:00
|
|
|
|
|
|
|
|
LL | let _: Vec<&str> = sp.skip(1).next().unwrap().split(' ').collect();
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
|
|
|
|
|
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:30:29
|
2021-12-30 15:10:43 +01:00
|
|
|
|
|
|
|
|
LL | let _: Vec<&str> = s.skip(1).next().unwrap().split(' ').collect();
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
|
|
|
|
|
|
|
|
error: called `skip(..).next()` on an iterator
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/iter_skip_next.rs:36:29
|
2021-12-30 15:10:43 +01:00
|
|
|
|
|
|
|
|
LL | let _: Vec<&str> = s.skip(1).next().unwrap().split(' ').collect();
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
2018-12-30 12:41:37 +01:00
|
|
|
|