RS.CLIPPY.UNUSED_FORMAT_SPECS

Use of a format specifier that has no effect

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: unused_format_specs. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Detects formatting parameters that have no effect on the output of format!(), println!() or similar macros.

Why is this bad?

Shorter format specifiers are easier to read, it may also indicate that an expected formatting operation such as adding padding isn't happening.

Example

println!("{:.}", 1.0);

println!("not padded: {:5}", format_args!("..."));

Use instead:

println!("{}", 1.0);

println!("not padded: {}", format_args!("..."));
// OR
println!("padded: {:5}", format!("..."));