mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-11 22:02:55 +00:00
20 lines
573 B
Text
20 lines
573 B
Text
error: `to_string()` called on a `&str`
|
|
--> $DIR/str_to_string.rs:4:17
|
|
|
|
|
LL | let hello = "hello world".to_string();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.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`
|
|
--> $DIR/str_to_string.rs:7:5
|
|
|
|
|
LL | msg.to_string();
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider using `.to_owned()`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|