2020-10-28 17:36:07 -05:00
|
|
|
error: for loop over a single element
|
|
|
|
--> $DIR/single_element_loop.rs:7:5
|
|
|
|
|
|
|
|
|
LL | / for item in &[item1] {
|
|
|
|
LL | | println!("{}", item);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::single-element-loop` implied by `-D warnings`
|
|
|
|
help: try
|
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ {
|
|
|
|
LL + let item = &item1;
|
|
|
|
LL + println!("{}", item);
|
|
|
|
LL + }
|
2020-10-28 17:36:07 -05:00
|
|
|
|
|
|
|
|
|
2021-04-27 09:55:11 -05:00
|
|
|
error: for loop over a single element
|
|
|
|
--> $DIR/single_element_loop.rs:11:5
|
|
|
|
|
|
|
|
|
LL | / for item in [item1].iter() {
|
|
|
|
LL | | println!("{:?}", item);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
2021-08-11 09:21:33 -05:00
|
|
|
LL ~ {
|
|
|
|
LL + let item = &item1;
|
|
|
|
LL + println!("{:?}", item);
|
|
|
|
LL + }
|
2021-04-27 09:55:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2020-10-28 17:36:07 -05:00
|
|
|
|