Closed
Description
When a format string is used to output braces, they need to be escaped by doubling them:format!("{{}}")
creates a string containing "{}".
The clippy lint clippy::useless_format seems to not know that:
warning: useless use of `format!`
format!("{{}}")
^^^^^^^^^^^^^^^ help: consider using .to_string(): `"{{}}".to_string()`
Here, the recommendation should read "{}".to_string()
instead.
Further information:
cargo clippy -V
clippy 0.0.212 (1b89724 2019-01-15)