Files
rust/tests/ui/bytes_nth.rs

11 lines
258 B
Rust
Raw Normal View History

#![allow(clippy::unnecessary_operation)]
2025-01-15 15:58:18 +01:00
#![allow(clippy::slice_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);
}