|
1 | 1 | error: You are using an explicit closure for copying elements |
2 | | - --> $DIR/map_clone.rs:9:22 |
| 2 | + --> $DIR/map_clone.rs:10:22 |
3 | 3 | | |
4 | 4 | LL | let _: Vec<i8> = vec![5_i8; 6].iter().map(|x| *x).collect(); |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `vec![5_i8; 6].iter().copied()` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::map-clone` implied by `-D warnings` |
8 | 8 |
|
9 | 9 | error: You are using an explicit closure for cloning elements |
10 | | - --> $DIR/map_clone.rs:10:26 |
| 10 | + --> $DIR/map_clone.rs:11:26 |
11 | 11 | | |
12 | 12 | LL | let _: Vec<String> = vec![String::new()].iter().map(|x| x.clone()).collect(); |
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `cloned` method: `vec![String::new()].iter().cloned()` |
14 | 14 |
|
15 | 15 | error: You are using an explicit closure for copying elements |
16 | | - --> $DIR/map_clone.rs:11:23 |
| 16 | + --> $DIR/map_clone.rs:12:23 |
17 | 17 | | |
18 | 18 | LL | let _: Vec<u32> = vec![42, 43].iter().map(|&x| x).collect(); |
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `vec![42, 43].iter().copied()` |
20 | 20 |
|
21 | 21 | error: You are using an explicit closure for copying elements |
22 | | - --> $DIR/map_clone.rs:13:26 |
| 22 | + --> $DIR/map_clone.rs:14:26 |
23 | 23 | | |
24 | 24 | LL | let _: Option<u64> = Some(&16).map(|b| *b); |
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `Some(&16).copied()` |
26 | 26 |
|
27 | 27 | error: You are using an explicit closure for copying elements |
28 | | - --> $DIR/map_clone.rs:14:25 |
| 28 | + --> $DIR/map_clone.rs:15:25 |
29 | 29 | | |
30 | 30 | LL | let _: Option<u8> = Some(&1).map(|x| x.clone()); |
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `Some(&1).copied()` |
32 | 32 |
|
33 | 33 | error: You are needlessly cloning iterator elements |
34 | | - --> $DIR/map_clone.rs:25:29 |
| 34 | + --> $DIR/map_clone.rs:26:29 |
35 | 35 | | |
36 | 36 | LL | let _ = std::env::args().map(|v| v.clone()); |
37 | 37 | | ^^^^^^^^^^^^^^^^^^^ help: Remove the `map` call |
|
0 commit comments