blob: 296b8e36f28c888a8dcb38de33c00f272c7c4800 [file] [log] [blame]
error: `to_string()` called on a `&str`
--> tests/ui/str_to_string.rs:4:17
|
LL | let hello = "hello world".to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"hello world".to_owned()`
|
= note: `-D clippy::str-to-string` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::str_to_string)]`
error: `to_string()` called on a `&str`
--> tests/ui/str_to_string.rs:8:5
|
LL | msg.to_string();
| ^^^^^^^^^^^^^^^ help: try: `msg.to_owned()`
error: `to_string()` called on a `&str`
--> tests/ui/str_to_string.rs:22:18
|
LL | let _value = t!(str::from_utf8(key)).to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t!(str::from_utf8(key)).to_owned()`
error: `ToString::to_string` used as `&str` to `String` converter
--> tests/ui/str_to_string.rs:35:19
|
LL | let _ = x.map(ToString::to_string);
| ^^^^^^^^^^^^^^^^^^^ help: try: `ToOwned::to_owned`
error: `ToString::to_string` used as `&str` to `String` converter
--> tests/ui/str_to_string.rs:38:19
|
LL | let _ = x.map(str::to_string);
| ^^^^^^^^^^^^^^ help: try: `ToOwned::to_owned`
error: `ToString::to_string` used as `&str` to `String` converter
--> tests/ui/str_to_string.rs:41:35
|
LL | let _ = ["a", "b"].iter().map(ToString::to_string);
| ^^^^^^^^^^^^^^^^^^^ help: try: `ToOwned::to_owned`
error: `ToString::to_string` used as `&str` to `String` converter
--> tests/ui/str_to_string.rs:47:20
|
LL | let _ = mapper(ToString::to_string);
| ^^^^^^^^^^^^^^^^^^^ help: try: `ToOwned::to_owned`
error: `ToString::to_string` used as `&str` to `String` converter
--> tests/ui/str_to_string.rs:51:22
|
LL | let _ = w.mapper(ToString::to_string);
| ^^^^^^^^^^^^^^^^^^^ help: try: `ToOwned::to_owned`
error: aborting due to 8 previous errors