2016-02-20 17:35:07 +01:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(useless_format)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
format!("foo"); //~ERROR useless use of `format!`
|
2016-02-20 21:15:05 +01:00
|
|
|
format!("{}", 42); //~ERROR useless use of `format!`
|
|
|
|
format!("{:?}", 42); // we only want to warn about `{}`
|
|
|
|
format!("{:+}", 42); // we only want to warn about `{}`
|
2016-02-20 17:35:07 +01:00
|
|
|
format!("foo {}", 42);
|
2016-02-20 21:15:05 +01:00
|
|
|
format!("{} bar", 42);
|
2016-02-20 17:35:07 +01:00
|
|
|
|
|
|
|
println!("foo");
|
|
|
|
println!("foo {}", 42);
|
|
|
|
}
|