Skip to content

Remove redundant format!s #96289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ impl<'a> Resolver<'a> {
}
ResolutionError::InvalidAsmSym => {
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
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
"invalid lifetime parameter name: `{}`",
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();
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,9 +968,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
SuggestionText::Remove(plural) => {
Some(format!("remove the extra argument{}", if plural { "s" } else { "" }))
}
SuggestionText::Swap => Some(format!("swap these arguments")),
SuggestionText::Reorder => Some(format!("reorder these arguments")),
SuggestionText::DidYouMean => Some(format!("did you mean")),
SuggestionText::Swap => Some("swap these arguments".to_string()),
SuggestionText::Reorder => Some("reorder these arguments".to_string()),
SuggestionText::DidYouMean => Some("did you mean".to_string()),
};
if let Some(suggestion_text) = suggestion_text {
let source_map = self.sess().source_map();
Expand Down