rust-clippy
rust-clippy copied to clipboard
Add suggestion to useless_format
Just saw this code produce this error
warning: useless use of `format!`
--> src/main.rs:2:39
|
2 | let _foo = Some(42).ok_or_else(|| format!("baz"));
| ^^^^^^^^^^^^^^
|
= note: #[warn(useless_format)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#useless_format
which has no suggestion. We should add one that suggests "baz".to_string().
I'd like to work on this issue if that's alright!