use &str / String literals instead of format!()

This commit is contained in:
Matthias Krüger 2022-12-18 16:17:46 +01:00
parent 35a99eef32
commit 3af7df91fc
19 changed files with 37 additions and 55 deletions

View file

@ -649,7 +649,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
if !assign_value.is_empty() {
err.span_suggestion_verbose(
sugg_span.shrink_to_hi(),
format!("consider assigning a value"),
"consider assigning a value",
format!(" = {}", assign_value),
Applicability::MaybeIncorrect,
);

View file

@ -270,7 +270,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
for extra in extra_info {
match extra {
ExtraConstraintInfo::PlaceholderFromPredicate(span) => {
err.span_note(*span, format!("due to current limitations in the borrow checker, this implies a `'static` lifetime"));
err.span_note(*span, "due to current limitations in the borrow checker, this implies a `'static` lifetime");
}
}
}

View file

@ -472,7 +472,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
for extra in extra_info {
match extra {
ExtraConstraintInfo::PlaceholderFromPredicate(span) => {
diag.span_note(span, format!("due to current limitations in the borrow checker, this implies a `'static` lifetime"));
diag.span_note(span, "due to current limitations in the borrow checker, this implies a `'static` lifetime");
}
}
}