Skip to content

Commit 748925b

Browse files
authored
Rollup merge of rust-lang#100534 - Rageking8:Rageking8-refactor1, r=compiler-errors
Make code slightly more uniform
2 parents a5cdb65 + 44f878d commit 748925b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ impl<'a> Parser<'a> {
590590
)
591591
} else if expected.is_empty() {
592592
(
593-
format!("unexpected token: {}", actual),
593+
format!("unexpected token: {actual}"),
594594
(self.prev_token.span, "unexpected token after this".to_string()),
595595
)
596596
} else {
@@ -1497,7 +1497,7 @@ impl<'a> Parser<'a> {
14971497
MultiSugg {
14981498
msg: format!("use `{}= 1` instead", kind.op.chr()),
14991499
patches: vec![
1500-
(pre_span, format!("{{ let {} = ", tmp_var)),
1500+
(pre_span, format!("{{ let {tmp_var} = ")),
15011501
(post_span, format!("; {} {}= 1; {} }}", base_src, kind.op.chr(), tmp_var)),
15021502
],
15031503
applicability: Applicability::HasPlaceholders,

0 commit comments

Comments
 (0)