Files
rust/tests/ui/string_to_string_in_map.stderr
T

39 lines
1.4 KiB
Plaintext

error: `to_string()` called on a `String`
--> tests/ui/string_to_string_in_map.rs:8:23
|
LL | let _ = variable2.map(String::to_string);
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
|
note: the lint level is defined here
--> tests/ui/string_to_string_in_map.rs:1:9
|
LL | #![deny(clippy::string_to_string)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: `to_string()` called on a `String`
--> tests/ui/string_to_string_in_map.rs:10:23
|
LL | let _ = variable2.map(|x| x.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
error: `to_string()` called on a `String`
--> tests/ui/string_to_string_in_map.rs:13:23
|
LL | let _ = variable2.map(|x| { x.to_string() });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
error: `to_string()` called on a `String`
--> tests/ui/string_to_string_in_map.rs:16:40
|
LL | let _ = vec![String::new()].iter().map(String::to_string).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
error: `to_string()` called on a `String`
--> tests/ui/string_to_string_in_map.rs:18:40
|
LL | let _ = vec![String::new()].iter().map(|x| x.to_string()).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `cloned()`
error: aborting due to 5 previous errors