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