]> git.lizzy.rs Git - rust.git/blob - tests/ui/bytes_nth.fixed
Auto merge of #85538 - r00ster91:iterrepeat, r=Mark-Simulacrum
[rust.git] / tests / ui / bytes_nth.fixed
1 // run-rustfix
2
3 #![allow(clippy::unnecessary_operation)]
4 #![warn(clippy::bytes_nth)]
5
6 fn main() {
7     let s = String::from("String");
8     s.as_bytes().get(3);
9     let _ = &s.as_bytes().get(3);
10     s[..].as_bytes().get(3);
11 }