about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-17 12:21:50 +0200
committerGitHub <noreply@github.com>2022-06-17 12:21:50 +0200
commit847e692b050e34ea2a42bc4dd0c933d8ed1387ef (patch)
tree279b8f0454fa9e4af92080715df800557ba277ff
parent4793397f1105e5c8ef04a736a18ef32df8a49d2f (diff)
parent2135331a3352fa81dcb8592daa435d7a32d93ca0 (diff)
downloadrust-847e692b050e34ea2a42bc4dd0c933d8ed1387ef.tar.gz
rust-847e692b050e34ea2a42bc4dd0c933d8ed1387ef.zip
Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string, 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.
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs8
-rw-r--r--src/tools/clippy/clippy_utils/src/sugg.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index c56f70e853d..acf892cec53 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -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(),
@@ -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(),
diff --git a/src/tools/clippy/clippy_utils/src/sugg.rs b/src/tools/clippy/clippy_utils/src/sugg.rs
index 4d21ba8bd1d..aa119539b1b 100644
--- a/src/tools/clippy/clippy_utils/src/sugg.rs
+++ b/src/tools/clippy/clippy_utils/src/sugg.rs
@@ -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);
     }
 }