about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRageking8 <106309953+Rageking8@users.noreply.github.com>2022-08-14 22:17:49 +0800
committerGitHub <noreply@github.com>2022-08-14 22:17:49 +0800
commit44f878d75f0d1d37cec965e628faf99b18826ad8 (patch)
tree31d7da00a876900266391909f0d272a595bd7e1c
parent2fbc08e2ce64dee45a29cb6133da6b32366268aa (diff)
downloadrust-44f878d75f0d1d37cec965e628faf99b18826ad8.tar.gz
rust-44f878d75f0d1d37cec965e628faf99b18826ad8.zip
Make code slightly more uniform
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index f4c6b33a529..018f0ad71ef 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -590,7 +590,7 @@ impl<'a> Parser<'a> {
             )
         } else if expected.is_empty() {
             (
-                format!("unexpected token: {}", actual),
+                format!("unexpected token: {actual}"),
                 (self.prev_token.span, "unexpected token after this".to_string()),
             )
         } else {
@@ -1497,7 +1497,7 @@ impl<'a> Parser<'a> {
         MultiSugg {
             msg: format!("use `{}= 1` instead", kind.op.chr()),
             patches: vec![
-                (pre_span, format!("{{ let {} = ", tmp_var)),
+                (pre_span, format!("{{ let {tmp_var} = ")),
                 (post_span, format!("; {} {}= 1; {} }}", base_src, kind.op.chr(), tmp_var)),
             ],
             applicability: Applicability::HasPlaceholders,