Make code slightly more uniform

This commit is contained in:
Rageking8 2022-08-14 22:17:49 +08:00 committed by GitHub
parent 2fbc08e2ce
commit 44f878d75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -590,7 +590,7 @@ fn is_ident_eq_keyword(found: &TokenKind, expected: &TokenType) -> bool {
)
} 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 @@ fn postfix_inc_dec_suggest(
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,