Closed
Description
What it does
This lint suggests using the feature added in the 1.58 version of Rust: implicit named arguments for formatting macros.
Lint Name
implicit_named_arguments
Category
style
Advantage
- Slightly less verbose code.
- (Arguably) less error prone code.
Drawbacks
The only drawback that I can see is that not everyone would probably be happy with this lint, so perhaps it should be opt-in (pedantic).
Example
println!("1 = {}, 2 = {}, 3 = {}", first, second, third);
Could be written as:
println!("1 = {first}, 2 = {second}, 3 = {third}");