Skip to content

Commit

Permalink
Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string…
Browse files Browse the repository at this point in the history
…, r=Dylan-DPC

Remove the rest of unnecessary `to_string`

I removed most of unnecessary `to_string` in #98043. This patch removes the rest of them I missed.
  • Loading branch information
Dylan-DPC authored Jun 17, 2022
2 parents 4793397 + 2135331 commit 847e692
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2042,9 +2042,9 @@ impl<'a> Parser<'a> {
match pat.kind {
PatKind::Ident(_, ident, _) => (
ident,
"self: ".to_string(),
"self: ",
": TypeName".to_string(),
"_: ".to_string(),
"_: ",
pat.span.shrink_to_lo(),
pat.span.shrink_to_hi(),
pat.span.shrink_to_lo(),
Expand All @@ -2058,9 +2058,9 @@ impl<'a> Parser<'a> {
let mutab = mutab.prefix_str();
(
ident,
"self: ".to_string(),
"self: ",
format!("{ident}: &{mutab}TypeName"),
"_: ".to_string(),
"_: ",
pat.span.shrink_to_lo(),
pat.span,
pat.span.shrink_to_lo(),
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ impl<T: LintContext> DiagnosticExt<T> for rustc_errors::Diagnostic {
}
}

self.span_suggestion(remove_span, msg, String::new(), applicability);
self.span_suggestion(remove_span, msg, "", applicability);
}
}

Expand Down

0 comments on commit 847e692

Please sign in to comment.