diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-03 21:29:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-03 21:29:43 +0100 |
| commit | 968cff7cf351035fc71cb8ba6c21fc4ec518d872 (patch) | |
| tree | 5d4c21786df826bf6664d08468f2e1e2c9fbb1e6 /compiler/rustc_parse/src/parser | |
| parent | 019d28151d5ceabd2214ca7f03c37e105f45028c (diff) | |
| parent | ef37dcb7dbb444751b825adb55f2246b4fa3a52b (diff) | |
| download | rust-968cff7cf351035fc71cb8ba6c21fc4ec518d872.tar.gz rust-968cff7cf351035fc71cb8ba6c21fc4ec518d872.zip | |
Rollup merge of #120592 - trevyn:cleanup-to-string, r=Nilstrieb
Remove unnecessary `.to_string()`/`.as_str()`s
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/generics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 9f748e2a3fe..e36a648e203 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -3288,7 +3288,7 @@ impl<'a> Parser<'a> { } else { Applicability::MaybeIncorrect }; - err.span_suggestion_verbose(sugg_sp, msg, "=> ".to_string(), applicability); + err.span_suggestion_verbose(sugg_sp, msg, "=> ", applicability); } } err diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 48cf04f7790..e059e707491 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -148,7 +148,7 @@ impl<'a> Parser<'a> { .with_span_suggestion_verbose( mistyped_const_ident.span, "use the `const` keyword", - kw::Const.as_str(), + kw::Const, Applicability::MachineApplicable, ) .emit(); diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 9a77643f951..8050b34956c 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1453,7 +1453,7 @@ impl<'a> Parser<'a> { err.span_suggestion_verbose( prev_span, "perhaps you meant to use `struct` here", - "struct".to_string(), + "struct", Applicability::MaybeIncorrect, ); } |
