summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/bytes_nth.fixed
blob: b1fb2e16bd5841c13cc64a83cb2fc46808df7d12 (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-rustfix

#![allow(clippy::unnecessary_operation)]
#![warn(clippy::bytes_nth)]

fn main() {
    let s = String::from("String");
    let _ = s.as_bytes().get(3);
    let _ = &s.as_bytes().get(3);
    let _ = s[..].as_bytes().get(3);
}