blob: 6f4c2e7116e97d7f87f5f87de7850e10d814f8c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#![allow(clippy::unnecessary_operation)]
#![allow(clippy::sliced_string_as_bytes)]
#![warn(clippy::bytes_nth)]
fn main() {
let s = String::from("String");
let _ = s.as_bytes().get(3).copied();
//~^ bytes_nth
let _ = &s.as_bytes()[3];
//~^ bytes_nth
let _ = s[..].as_bytes().get(3).copied();
//~^ bytes_nth
}
|