Remove redundant format!s

This commit is contained in:
Nixon Enraght-Moony 2022-04-21 16:46:03 +01:00
parent 1dec35a1b0
commit 8fa20e01a5
3 changed files with 5 additions and 5 deletions

View File

@ -1014,7 +1014,7 @@ impl<'a> Resolver<'a> {
} }
ResolutionError::InvalidAsmSym => { ResolutionError::InvalidAsmSym => {
let mut err = self.session.struct_span_err(span, "invalid `sym` operand"); let mut err = self.session.struct_span_err(span, "invalid `sym` operand");
err.span_label(span, &format!("is a local variable")); err.span_label(span, "is a local variable");
err.help("`sym` operands must refer to either a function or a static"); err.help("`sym` operands must refer to either a function or a static");
err err
} }

View File

@ -1696,7 +1696,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
"invalid lifetime parameter name: `{}`", "invalid lifetime parameter name: `{}`",
param.ident, param.ident,
) )
.span_label(param.ident.span, format!("'static is a reserved lifetime name")) .span_label(param.ident.span, "'static is a reserved lifetime name")
.emit(); .emit();
continue; continue;
} }

View File

@ -968,9 +968,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
SuggestionText::Remove(plural) => { SuggestionText::Remove(plural) => {
Some(format!("remove the extra argument{}", if plural { "s" } else { "" })) Some(format!("remove the extra argument{}", if plural { "s" } else { "" }))
} }
SuggestionText::Swap => Some(format!("swap these arguments")), SuggestionText::Swap => Some("swap these arguments".to_string()),
SuggestionText::Reorder => Some(format!("reorder these arguments")), SuggestionText::Reorder => Some("reorder these arguments".to_string()),
SuggestionText::DidYouMean => Some(format!("did you mean")), SuggestionText::DidYouMean => Some("did you mean".to_string()),
}; };
if let Some(suggestion_text) = suggestion_text { if let Some(suggestion_text) = suggestion_text {
let source_map = self.sess().source_map(); let source_map = self.sess().source_map();