Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb
use &str / String literals instead of format!()
This commit is contained in:
commit
ebe3563764
19 changed files with 37 additions and 55 deletions
|
@ -184,7 +184,7 @@ fn msg_span_from_early_bound_and_free_regions<'tcx>(
|
|||
let text = if br.has_name() {
|
||||
format!("the lifetime `{}` as defined here", br.name)
|
||||
} else {
|
||||
format!("the anonymous lifetime as defined here")
|
||||
"the anonymous lifetime as defined here".to_string()
|
||||
};
|
||||
(text, sp)
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ fn msg_span_from_early_bound_and_free_regions<'tcx>(
|
|||
sp = param.span;
|
||||
}
|
||||
let text = if name == kw::UnderscoreLifetime {
|
||||
format!("the anonymous lifetime as defined here")
|
||||
"the anonymous lifetime as defined here".to_string()
|
||||
} else {
|
||||
format!("the lifetime `{}` as defined here", name)
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
|
|||
);
|
||||
}
|
||||
(Some(sub_span), Some(sup_span), _, Some(sup_symbol)) => {
|
||||
err.span_note(sub_span, format!("the lifetime defined here..."));
|
||||
err.span_note(sub_span, "the lifetime defined here...");
|
||||
err.span_note(
|
||||
sup_span,
|
||||
format!("...must outlive the lifetime `{sup_symbol}` defined here"),
|
||||
|
@ -55,17 +55,11 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
|
|||
sub_span,
|
||||
format!("the lifetime `{sub_symbol}` defined here..."),
|
||||
);
|
||||
err.span_note(
|
||||
sup_span,
|
||||
format!("...must outlive the lifetime defined here"),
|
||||
);
|
||||
err.span_note(sup_span, "...must outlive the lifetime defined here");
|
||||
}
|
||||
(Some(sub_span), Some(sup_span), _, _) => {
|
||||
err.span_note(sub_span, format!("the lifetime defined here..."));
|
||||
err.span_note(
|
||||
sup_span,
|
||||
format!("...must outlive the lifetime defined here"),
|
||||
);
|
||||
err.span_note(sub_span, "the lifetime defined here...");
|
||||
err.span_note(sup_span, "...must outlive the lifetime defined here");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue