granite-rust/tests/compile-fail/format.rs

16 lines
414 B
Rust
Raw Normal View History

#![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 `{}`
format!("foo {}", 42);
2016-02-20 21:15:05 +01:00
format!("{} bar", 42);
println!("foo");
println!("foo {}", 42);
}