1
Fork 0

clippy::useless_format

This commit is contained in:
Matthias Krüger 2021-07-21 22:43:19 +02:00
parent d0a8a12dc6
commit 3fd8cbb404
14 changed files with 17 additions and 17 deletions

View file

@ -320,7 +320,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
.map(|n| format!("`{}`", n))
.unwrap_or_else(|| "the mutable reference".to_string()),
),
format!("&mut *"),
"&mut *".to_string(),
Applicability::MachineApplicable,
);
}

View file

@ -721,7 +721,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
if suggestions.peek().is_some() {
err.span_suggestions(
path_segment.ident.span,
&format!("use mutable method"),
"use mutable method",
suggestions,
Applicability::MaybeIncorrect,
);

View file

@ -255,7 +255,7 @@ impl NonConstOp for CellBorrow {
);
err.span_label(
span,
format!("this borrow of an interior mutable value may end up in the final value"),
"this borrow of an interior mutable value may end up in the final value",
);
if let hir::ConstContext::Static(_) = ccx.const_kind() {
err.help(

View file

@ -344,7 +344,7 @@ impl DebugCounters {
return if counter_format.id {
format!("{}#{}", block_label, id.index())
} else {
format!("{}", block_label)
block_label.to_string()
};
}
}
@ -369,7 +369,7 @@ impl DebugCounters {
}
return format!("({})", self.format_counter_kind(counter_kind));
}
return format!("{}", self.format_counter_kind(counter_kind));
return self.format_counter_kind(counter_kind).to_string();
}
}
format!("#{}", operand.index().to_string())

View file

@ -147,8 +147,8 @@ fn validate_simd_shuffle(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span)
match &args[2] {
Operand::Constant(_) => {} // all good
_ => {
let msg = format!("last argument of `simd_shuffle` is required to be a `const` item");
tcx.sess.span_err(span, &msg);
let msg = "last argument of `simd_shuffle` is required to be a `const` item";
tcx.sess.span_err(span, msg);
}
}
}

View file

@ -479,7 +479,7 @@ impl Visitor<'tcx> for ExtraComments<'tcx> {
uv.promoted
),
ty::ConstKind::Value(val) => format!("Value({:?})", val),
ty::ConstKind::Error(_) => format!("Error"),
ty::ConstKind::Error(_) => "Error".to_string(),
};
self.push(&format!("+ val: {}", val));
}