rust-clippy/tests/ui/iter_next_slice.stderr

29 lines
892 B
Text
Raw Normal View History

error: using `.iter().next()` on an array
2023-06-06 20:56:57 +00:00
--> $DIR/iter_next_slice.rs:10:13
|
LL | let _ = s.iter().next();
2022-05-24 09:55:39 +00:00
| ^^^^^^^^^^^^^^^ help: try calling: `s.first()`
|
= note: `-D clippy::iter-next-slice` implied by `-D warnings`
error: using `.iter().next()` on a Slice without end index
2023-06-06 20:56:57 +00:00
--> $DIR/iter_next_slice.rs:13:13
|
LL | let _ = s[2..].iter().next();
| ^^^^^^^^^^^^^^^^^^^^ help: try calling: `s.get(2)`
error: using `.iter().next()` on a Slice without end index
2023-06-06 20:56:57 +00:00
--> $DIR/iter_next_slice.rs:16:13
|
LL | let _ = v[5..].iter().next();
| ^^^^^^^^^^^^^^^^^^^^ help: try calling: `v.get(5)`
error: using `.iter().next()` on an array
2023-06-06 20:56:57 +00:00
--> $DIR/iter_next_slice.rs:19:13
|
LL | let _ = v.iter().next();
2022-05-24 09:55:39 +00:00
| ^^^^^^^^^^^^^^^ help: try calling: `v.first()`
error: aborting due to 4 previous errors