2021-02-11 15:04:38 +01:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![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.as_bytes().get(3);
|
2021-06-18 16:11:32 +08:00
|
|
|
let _ = &s.as_bytes().get(3);
|
2022-03-26 15:37:48 +01:00
|
|
|
let _ = s[..].as_bytes().get(3);
|
2021-02-11 15:04:38 +01:00
|
|
|
}
|