124 lines
4.3 KiB
Plaintext
124 lines
4.3 KiB
Plaintext
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:9:5
|
||
|
|
|
||
|
LL | vec.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in vec.iter() { .. }`
|
||
|
|
|
||
|
= note: `-D clippy::excessive-for-each` implied by `-D warnings`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:13:5
|
||
|
|
|
||
|
LL | vec_ref.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in vec_ref.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:17:5
|
||
|
|
|
||
|
LL | vec_deq.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in vec_deq.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:21:5
|
||
|
|
|
||
|
LL | list.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in list.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:25:5
|
||
|
|
|
||
|
LL | hash_map.iter().for_each(|(k, v)| println!("{}: {}", k, v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (k, v) in hash_map.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:26:5
|
||
|
|
|
||
|
LL | hash_map.iter_mut().for_each(|(k, v)| println!("{}: {}", k, v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (k, v) in hash_map.iter_mut() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:27:5
|
||
|
|
|
||
|
LL | hash_map.keys().for_each(|k| println!("{}", k));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for k in hash_map.keys() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:28:5
|
||
|
|
|
||
|
LL | hash_map.values().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in hash_map.values() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:32:5
|
||
|
|
|
||
|
LL | hash_set.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in hash_set.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:36:5
|
||
|
|
|
||
|
LL | btree_set.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in btree_set.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:40:5
|
||
|
|
|
||
|
LL | binary_heap.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in binary_heap.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:44:5
|
||
|
|
|
||
|
LL | s.iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in s.iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:47:5
|
||
|
|
|
||
|
LL | vec.as_slice().iter().for_each(|v| println!("{}", v));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for v in vec.as_slice().iter() { .. }`
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:50:5
|
||
|
|
|
||
|
LL | / vec.iter().for_each(|v| {
|
||
|
LL | | if *v == 10 {
|
||
|
LL | | return;
|
||
|
LL | | } else {
|
||
|
LL | | println!("{}", v);
|
||
|
LL | | }
|
||
|
LL | | });
|
||
|
| |______^ help: try: `for v in vec.iter() { .. }`
|
||
|
|
|
||
|
note: change `return` to `continue` in the loop body
|
||
|
--> $DIR/excessive_for_each.rs:52:13
|
||
|
|
|
||
|
LL | return;
|
||
|
| ^^^^^^
|
||
|
|
||
|
error: excessive use of `for_each`
|
||
|
--> $DIR/excessive_for_each.rs:59:5
|
||
|
|
|
||
|
LL | / vec.iter().for_each(|v| {
|
||
|
LL | | for i in 0..*v {
|
||
|
LL | | if i == 10 {
|
||
|
LL | | return;
|
||
|
... |
|
||
|
LL | | }
|
||
|
LL | | });
|
||
|
| |______^ help: try: `'outer: for v in vec.iter() { .. }`
|
||
|
|
|
||
|
note: change `return` to `continue 'outer` in the loop body
|
||
|
--> $DIR/excessive_for_each.rs:62:17
|
||
|
|
|
||
|
LL | return;
|
||
|
| ^^^^^^
|
||
|
note: change `return` to `continue` in the loop body
|
||
|
--> $DIR/excessive_for_each.rs:68:13
|
||
|
|
|
||
|
LL | return;
|
||
|
| ^^^^^^
|
||
|
|
||
|
error: aborting due to 15 previous errors
|
||
|
|