rust/tests/ui-toml/explicit_iter_loop/explicit_iter_loop.rs
2023-09-24 15:19:18 +02:00

11 lines
319 B
Rust

#![warn(clippy::explicit_iter_loop)]
fn main() {
let mut vec = vec![1, 2, 3];
let rmvec = &mut vec;
for _ in rmvec.iter() {}
//~^ ERROR: it is more concise to loop over references to containers
for _ in rmvec.iter_mut() {}
//~^ ERROR: it is more concise to loop over references to containers
}