2020-10-03 13:46:28 -05:00
|
|
|
// run-rustfix
|
|
|
|
// Tests from for_loop.rs that don't have suggestions
|
|
|
|
|
|
|
|
#[warn(clippy::single_element_loop)]
|
|
|
|
fn main() {
|
|
|
|
let item1 = 2;
|
|
|
|
for item in &[item1] {
|
|
|
|
println!("{}", item);
|
|
|
|
}
|
2021-04-25 11:10:38 -05:00
|
|
|
|
|
|
|
for item in [item1].iter() {
|
|
|
|
println!("{:?}", item);
|
|
|
|
}
|
2020-10-03 13:46:28 -05:00
|
|
|
}
|