mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 17:15:05 +00:00
ec23db9496
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
19 lines
401 B
Text
19 lines
401 B
Text
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
|
|
|
|
|
LL | {
|
|
LL | let item = &item1;
|
|
LL | println!("{}", item);
|
|
LL | }
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|