|
1 | 1 | error: `to_string()` called on a `String` |
2 | | - --> tests/ui/string_to_string_in_map.rs:8:13 |
| 2 | + --> tests/ui/string_to_string_in_map.rs:8:23 |
3 | 3 | | |
4 | 4 | LL | let _ = variable2.map(String::to_string); |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()` |
6 | 6 | | |
7 | | - = help: consider using `.cloned()` |
8 | 7 | note: the lint level is defined here |
9 | 8 | --> tests/ui/string_to_string_in_map.rs:1:9 |
10 | 9 | | |
11 | 10 | LL | #![deny(clippy::string_to_string)] |
12 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ |
13 | 12 |
|
14 | 13 | error: `to_string()` called on a `String` |
15 | | - --> tests/ui/string_to_string_in_map.rs:12:9 |
16 | | - | |
17 | | -LL | x.to_string() |
18 | | - | ^^^^^^^^^^^^^ |
19 | | - | |
20 | | - = help: consider using `.clone()` |
21 | | - |
22 | | -error: `to_string()` called on a `String` |
23 | | - --> tests/ui/string_to_string_in_map.rs:15:13 |
| 14 | + --> tests/ui/string_to_string_in_map.rs:10:23 |
24 | 15 | | |
25 | 16 | LL | let _ = variable2.map(|x| x.to_string()); |
26 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
27 | | - | |
28 | | - = help: consider using `.cloned()` |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()` |
29 | 18 |
|
30 | 19 | error: `to_string()` called on a `String` |
31 | | - --> tests/ui/string_to_string_in_map.rs:18:33 |
32 | | - | |
33 | | -LL | let _ = x.unwrap_or_else(|| v.to_string()); |
34 | | - | ^^^^^^^^^^^^^ |
35 | | - | |
36 | | - = help: consider using `.clone()` |
37 | | - |
38 | | -error: `to_string()` called on a `String` |
39 | | - --> tests/ui/string_to_string_in_map.rs:21:13 |
| 20 | + --> tests/ui/string_to_string_in_map.rs:13:40 |
40 | 21 | | |
41 | 22 | LL | let _ = vec![String::new()].iter().map(String::to_string).collect::<Vec<_>>(); |
42 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
43 | | - | |
44 | | - = help: consider using `.cloned()` |
| 23 | + | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()` |
45 | 24 |
|
46 | 25 | error: `to_string()` called on a `String` |
47 | | - --> tests/ui/string_to_string_in_map.rs:23:13 |
| 26 | + --> tests/ui/string_to_string_in_map.rs:15:40 |
48 | 27 | | |
49 | 28 | LL | let _ = vec![String::new()].iter().map(|x| x.to_string()).collect::<Vec<_>>(); |
50 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
51 | | - | |
52 | | - = help: consider using `.cloned()` |
| 29 | + | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()` |
53 | 30 |
|
54 | | -error: aborting due to 6 previous errors |
| 31 | +error: aborting due to 4 previous errors |
55 | 32 |
|
0 commit comments