summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/single_element_loop.rs
blob: 2c0c03b7211993ee22d5c5022818eec6842cb283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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);
    }

    for item in [item1].iter() {
        println!("{:?}", item);
    }
}