You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In edition 2021 format! and related macros have a new ability to use implicitly captured variables instead of positional arguments: format!("hello {name}");
Lint Name
format_uncaptured_variables
Category
pedantic
Advantage
A lint with an auto-fix could help migrate codebases to the new style. Opposite of #5404.
Drawbacks
format! with a mix of captured and positional args may be confusing:
format("{} {second}", x.first);
so the lint could be limited to cases where all args can be captured.
Example
format!("hello {:^5}", name);
Could be written as:
format!("hello {name:^5}");
The text was updated successfully, but these errors were encountered:
What it does
In edition 2021
format!
and related macros have a new ability to use implicitly captured variables instead of positional arguments:format!("hello {name}");
Lint Name
format_uncaptured_variables
Category
pedantic
Advantage
A lint with an auto-fix could help migrate codebases to the new style. Opposite of #5404.
Drawbacks
format!
with a mix of captured and positional args may be confusing:so the lint could be limited to cases where all args can be captured.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: