summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/unused_format_specs.rs
blob: ee192a000d4b55e6fd4d1a8c8ba72238cc626a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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);
}