rust/tests/ui/bytes_nth.rs
2025-01-28 19:33:54 +01:00

10 lines
266 B
Rust

#![allow(clippy::unnecessary_operation)]
#![allow(clippy::sliced_string_as_bytes)]
#![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);
}