clippy 0.0.212 (5afdf8b 2018-10-14)
in this code
fn main() {
let _: &str = &format!("hello");
}
clippy suggests
warning: useless use of `format!`
--> src/main.rs:2:20
|
2 | let _: &str = &format!("hello");
| ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"hello".to_string()`
|
but I think a better solution would be to simply omit the format!() like
let _: &str = &"hello";
or
let _: &str = "hello";
clippy 0.0.212 (5afdf8b 2018-10-14)in this code
clippy suggests
but I think a better solution would be to simply omit the
format!()likelet _: &str = &"hello";or
let _: &str = "hello";