Lint about usage of format!("string literal")

This commit is contained in:
mcarton 2016-02-20 17:35:07 +01:00
parent 222086d62b
commit ef4401d4ac
4 changed files with 55 additions and 1 deletions

11
tests/compile-fail/format.rs Executable file
View file

@ -0,0 +1,11 @@
#![feature(plugin)]
#![plugin(clippy)]
#![deny(useless_format)]
fn main() {
format!("foo"); //~ERROR useless use of `format!`
format!("foo {}", 42);
println!("foo");
println!("foo {}", 42);
}