Skip to content

Commit 847e692

Browse files
authored
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.
2 parents 4793397 + 2135331 commit 847e692

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2042,9 +2042,9 @@ impl<'a> Parser<'a> {
20422042
match pat.kind {
20432043
PatKind::Ident(_, ident, _) => (
20442044
ident,
2045-
"self: ".to_string(),
2045+
"self: ",
20462046
": TypeName".to_string(),
2047-
"_: ".to_string(),
2047+
"_: ",
20482048
pat.span.shrink_to_lo(),
20492049
pat.span.shrink_to_hi(),
20502050
pat.span.shrink_to_lo(),
@@ -2058,9 +2058,9 @@ impl<'a> Parser<'a> {
20582058
let mutab = mutab.prefix_str();
20592059
(
20602060
ident,
2061-
"self: ".to_string(),
2061+
"self: ",
20622062
format!("{ident}: &{mutab}TypeName"),
2063-
"_: ".to_string(),
2063+
"_: ",
20642064
pat.span.shrink_to_lo(),
20652065
pat.span,
20662066
pat.span.shrink_to_lo(),

src/tools/clippy/clippy_utils/src/sugg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ impl<T: LintContext> DiagnosticExt<T> for rustc_errors::Diagnostic {
771771
}
772772
}
773773

774-
self.span_suggestion(remove_span, msg, String::new(), applicability);
774+
self.span_suggestion(remove_span, msg, "", applicability);
775775
}
776776
}
777777

0 commit comments

Comments
 (0)