2023-04-20 14:37:15 +00:00
|
|
|
//@run-rustfix
|
2021-02-11 15:04:38 +01:00
|
|
|
|
|
|
|
#![allow(clippy::unnecessary_operation)]
|
|
|
|
#![warn(clippy::bytes_nth)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let s = String::from("String");
|
2022-03-26 15:37:48 +01:00
|
|
|
let _ = s.bytes().nth(3);
|
2023-02-16 16:41:04 +00:00
|
|
|
let _ = &s.bytes().nth(3).unwrap();
|
2022-03-26 15:37:48 +01:00
|
|
|
let _ = s[..].bytes().nth(3);
|
2021-02-11 15:04:38 +01:00
|
|
|
}
|