Skip to content

Add lint rule to enforce string formatting style #16021

Closed
@2010YOUY01

Description

@2010YOUY01

Is your feature request related to a problem or challenge?

#15999 changed the string format style as follows to improve readability:

// Before
.ok_or_else(|| format!("Invalid {} '{}'", label, size))?;

// After
.ok_or_else(|| format!("Invalid {label} '{size}'"))?;

As a follow-up task, it would be great to add a linter rule to enforce such style.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions