rust-lang / rust-lang/rust-clippy
Add `inlined_format_args`, opposite to `uninlined_format_args`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
Opposite of uninlined_format_args.
Advantage
Consistency. Not everything can be in lined, but everything can be 'not in-lined'.
With uninlined_format_args format!("{}", var); becomes format!("{var}");, but format!("{} {}", var, 1+2); cannot become format!("{var} {1+2}");, at best you can get format!("{var} {}", 1+2);
Drawbacks
Churn, collision with uninlined_format_args.
Example
format!("{var}");
format!("{var} {}", 1+2);
Could be written as:
format!("{}", var);
format!("{} {}", var, 1+2);
Comparison with existing lints
No response
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing uninlined_format_args lint and tracing how its behavior is tested. Clarify the opposite lint’s handling of expressions such as 1+2, account for the stated churn and collision drawbacks, and consider the work complete when the examples behave consistently with the agreed design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100