-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-lintArea: New lintsArea: New lints
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}");
xFrednet, edmorley, jonasbb, jplatte, est31 and 2 more
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lints