rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Useless format case `format!("{}", foo)` isn't listed for

Open Baelyk opened this issue 8 years ago • 0 comments

The useless_format lint identifies two cases:

  1. format!("foo")
  2. format!("{}", foo)

The first one works great, but the second one is ignored (gets no warning).

I noticed this while working on PR #2539. I originally thought that there just wasn't a test case in rust-clippy/tests/ui/format.rs, but after trying to add I noticed that there already was one, and the one I added also didn't get any warning. I also tried running clippy on a separate project and also got no warning.

Baelyk avatar Mar 17 '18 22:03 Baelyk