rust/tests/ui/bytes_nth.rs

12 lines
207 B
Rust
Raw Normal View History

2021-02-07 10:34:59 -06:00
// run-rustfix
2021-02-10 01:15:29 -06:00
#![allow(clippy::unnecessary_operation)]
2021-02-07 10:34:59 -06:00
#![warn(clippy::bytes_nth)]
fn main() {
2021-02-10 01:15:29 -06:00
let s = String::from("String");
s.bytes().nth(3);
&s.bytes().nth(3);
s[..].bytes().nth(3);
2021-02-07 10:34:59 -06:00
}