2023-07-02 07:35:19 -05:00
|
|
|
error: called `.iter().nth()` on a `Vec`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:34:23
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_vec = some_vec.iter().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::iter-nth` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::iter_nth)]`
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_vec = some_vec.get(3);
|
|
|
|
| ~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2020-01-24 02:04:46 -06:00
|
|
|
error: called `.iter().nth()` on a slice
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:35:26
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_slice = &some_vec[..].iter().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_slice = &some_vec[..].get(3);
|
|
|
|
| ~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2020-01-24 02:04:46 -06:00
|
|
|
error: called `.iter().nth()` on a slice
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:36:31
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_boxed_slice = boxed_slice.iter().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_boxed_slice = boxed_slice.get(3);
|
|
|
|
| ~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: called `.iter().nth()` on a `VecDeque`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:37:29
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_vec_deque = some_vec_deque.iter().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_vec_deque = some_vec_deque.get(3);
|
|
|
|
| ~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: called `.iter_mut().nth()` on a `Vec`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:42:23
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_vec = some_vec.iter_mut().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get_mut` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_vec = some_vec.get_mut(3);
|
|
|
|
| ~~~~~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2020-01-24 02:04:46 -06:00
|
|
|
error: called `.iter_mut().nth()` on a slice
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:45:26
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_slice = &some_vec[..].iter_mut().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get_mut` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_slice = &some_vec[..].get_mut(3);
|
|
|
|
| ~~~~~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: called `.iter_mut().nth()` on a `VecDeque`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/iter_nth.rs:48:29
|
2019-04-11 00:58:50 -05:00
|
|
|
|
|
|
|
|
LL | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 02:04:46 -06:00
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
help: `get_mut` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | let bad_vec_deque = some_vec_deque.get_mut(3);
|
|
|
|
| ~~~~~~~
|
|
|
|
|
|
|
|
error: called `.iter().nth()` on a `Vec`
|
|
|
|
--> tests/ui/iter_nth.rs:52:5
|
|
|
|
|
|
|
|
|
LL | vec_ref.iter().nth(3);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: `get` is equivalent but more concise
|
|
|
|
|
|
|
|
|
LL | vec_ref.get(3);
|
|
|
|
| ~~~
|
2019-04-11 00:58:50 -05:00
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
error: aborting due to 8 previous errors
|
2019-04-11 00:58:50 -05:00
|
|
|
|