diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-06-17 12:21:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-17 12:21:50 +0200 |
| commit | 847e692b050e34ea2a42bc4dd0c933d8ed1387ef (patch) | |
| tree | 279b8f0454fa9e4af92080715df800557ba277ff | |
| parent | 4793397f1105e5c8ef04a736a18ef32df8a49d2f (diff) | |
| parent | 2135331a3352fa81dcb8592daa435d7a32d93ca0 (diff) | |
| download | rust-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.rs | 8 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/sugg.rs | 2 |
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); } } |
