mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-19 17:44:21 +00:00
16 lines
599 B
Text
16 lines
599 B
Text
error: called `.byte().nth()` on a `str`
|
|
--> $DIR/bytes_nth.rs:6:13
|
|
|
|
|
LL | let _ = "Hello".bytes().nth(3);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.as_bytes().get()`: `"Hello".as_bytes().get(3)`
|
|
|
|
|
= note: `-D clippy::bytes-nth` implied by `-D warnings`
|
|
|
|
error: called `.byte().nth()` on a `String`
|
|
--> $DIR/bytes_nth.rs:8:13
|
|
|
|
|
LL | let _ = String::from("Hello").bytes().nth(3);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.as_bytes().get()`: `String::from("Hello").as_bytes().get(3)`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|