mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-28 07:30:57 +00:00
11 lines
309 B
Rust
11 lines
309 B
Rust
|
#![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
|
||
|
}
|