use &str / String literals instead of format!()
This commit is contained in:
parent
35a99eef32
commit
3af7df91fc
19 changed files with 37 additions and 55 deletions
|
@ -71,11 +71,11 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
|
|||
);
|
||||
} else {
|
||||
lint.multipart_suggestion_verbose(
|
||||
format!("to check pattern in a loop use `while let`"),
|
||||
"to check pattern in a loop use `while let`",
|
||||
vec![
|
||||
// NB can't use `until` here because `expr.span` and `pat.span` have different syntax contexts
|
||||
(expr.span.with_hi(pat.span.lo()), format!("while let {var}(")),
|
||||
(pat.span.between(arg.span), format!(") = ")),
|
||||
(pat.span.between(arg.span), ") = ".to_string()),
|
||||
],
|
||||
Applicability::MaybeIncorrect
|
||||
);
|
||||
|
@ -95,7 +95,7 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
|
|||
vec![
|
||||
// NB can't use `until` here because `expr.span` and `pat.span` have different syntax contexts
|
||||
(expr.span.with_hi(pat.span.lo()), format!("if let {var}(")),
|
||||
(pat.span.between(arg.span), format!(") = ")),
|
||||
(pat.span.between(arg.span), ") = ".to_string()),
|
||||
],
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue