2020-12-06 15:01:03 +01:00
|
|
|
#![warn(clippy::str_to_string)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let hello = "hello world".to_string();
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: `to_string()` called on a `&str`
|
2020-12-06 15:01:03 +01:00
|
|
|
let msg = &hello[..];
|
|
|
|
msg.to_string();
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: `to_string()` called on a `&str`
|
2020-12-06 15:01:03 +01:00
|
|
|
}
|