]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: for loop over a single element |
2 | --> $DIR/single_element_loop.rs:7:5 | |
3 | | | |
4 | LL | / for item in &[item1] { | |
5 | LL | | println!("{}", item); | |
6 | LL | | } | |
7 | | |_____^ | |
8 | | | |
9 | = note: `-D clippy::single-element-loop` implied by `-D warnings` | |
10 | help: try | |
11 | | | |
94222f64 XL |
12 | LL ~ { |
13 | LL + let item = &item1; | |
14 | LL + println!("{}", item); | |
15 | LL + } | |
f20569fa XL |
16 | | |
17 | ||
cdc7bbd5 XL |
18 | error: for loop over a single element |
19 | --> $DIR/single_element_loop.rs:11:5 | |
20 | | | |
21 | LL | / for item in [item1].iter() { | |
22 | LL | | println!("{:?}", item); | |
23 | LL | | } | |
24 | | |_____^ | |
25 | | | |
26 | help: try | |
27 | | | |
94222f64 XL |
28 | LL ~ { |
29 | LL + let item = &item1; | |
30 | LL + println!("{:?}", item); | |
31 | LL + } | |
cdc7bbd5 XL |
32 | | |
33 | ||
34 | error: aborting due to 2 previous errors | |
f20569fa | 35 |