rust-clippy/tests/ui-toml/explicit_iter_loop/explicit_iter_loop.fixed

11 lines
309 B
Rust
Raw Normal View History

2023-09-24 12:56:40 +00:00
#![warn(clippy::explicit_iter_loop)]
fn main() {
let mut vec = vec![1, 2, 3];
let rmvec = &mut vec;
for _ in &*rmvec {}
//~^ ERROR: it is more concise to loop over references to containers
for _ in &mut *rmvec {}
//~^ ERROR: it is more concise to loop over references to containers
}