rust/tests/ui/unused_format_specs.fixed

19 lines
300 B
Rust
Raw Normal View History

2022-10-13 07:13:54 -05:00
// run-rustfix
#![warn(clippy::unused_format_specs)]
#![allow(unused)]
fn main() {
let f = 1.0f64;
println!("{}", 1.0);
println!("{f} {f:?}");
println!("{}", 1);
}
fn should_not_lint() {
let f = 1.0f64;
println!("{:.1}", 1.0);
println!("{f:.w$} {f:.*?}", 3, w = 2);
}