2020-11-14 19:21:33 +05:30
|
|
|
#![warn(clippy::str_to_string)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let hello = "hello world".to_string();
|
2023-07-28 21:35:48 +02:00
|
|
|
//~^ ERROR: `to_string()` called on a `&str`
|
2020-11-14 19:21:33 +05:30
|
|
|
let msg = &hello[..];
|
|
|
|
msg.to_string();
|
2023-07-28 21:35:48 +02:00
|
|
|
//~^ ERROR: `to_string()` called on a `&str`
|
2020-11-14 19:21:33 +05:30
|
|
|
}
|