summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/bytes_nth.rs
blob: 62d9c7a5ea79b940553532b1d00d5081f8754ee3 (plain)
1
2
3
4
5
6
7
8
9
#![allow(clippy::unnecessary_operation)]
#![warn(clippy::bytes_nth)]

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