1
Fork 0

Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=Nilstrieb

use &str / String literals instead of format!()
This commit is contained in:
Matthias Krüger 2022-12-18 23:03:07 +01:00 committed by GitHub
commit ebe3563764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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");
}
}
}