]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unused_format_specs.rs
Rollup merge of #103287 - saethlin:faster-len-check, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / unused_format_specs.rs
1 // run-rustfix
2
3 #![warn(clippy::unused_format_specs)]
4 #![allow(unused)]
5
6 fn main() {
7     let f = 1.0f64;
8     println!("{:.}", 1.0);
9     println!("{f:.} {f:.?}");
10
11     println!("{:.}", 1);
12 }
13
14 fn should_not_lint() {
15     let f = 1.0f64;
16     println!("{:.1}", 1.0);
17     println!("{f:.w$} {f:.*?}", 3, w = 2);
18 }