Rollup merge of #100534 - Rageking8:Rageking8-refactor1, r=compiler-errors
Make code slightly more uniform
This commit is contained in:
commit
748925bf1b
@ -590,7 +590,7 @@ impl<'a> Parser<'a> {
|
|||||||
)
|
)
|
||||||
} else if expected.is_empty() {
|
} else if expected.is_empty() {
|
||||||
(
|
(
|
||||||
format!("unexpected token: {}", actual),
|
format!("unexpected token: {actual}"),
|
||||||
(self.prev_token.span, "unexpected token after this".to_string()),
|
(self.prev_token.span, "unexpected token after this".to_string()),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@ -1497,7 +1497,7 @@ impl<'a> Parser<'a> {
|
|||||||
MultiSugg {
|
MultiSugg {
|
||||||
msg: format!("use `{}= 1` instead", kind.op.chr()),
|
msg: format!("use `{}= 1` instead", kind.op.chr()),
|
||||||
patches: vec![
|
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)),
|
(post_span, format!("; {} {}= 1; {} }}", base_src, kind.op.chr(), tmp_var)),
|
||||||
],
|
],
|
||||||
applicability: Applicability::HasPlaceholders,
|
applicability: Applicability::HasPlaceholders,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user