1
Fork 0

use matches!() macro in more places

This commit is contained in:
Matthias Krüger 2021-11-06 01:31:32 +01:00
parent 3cd3bbecc5
commit 0a5640b55f
21 changed files with 49 additions and 86 deletions

View file

@ -212,7 +212,8 @@ impl AssocOp {
/// parentheses while having a high degree of confidence on the correctness of the suggestion.
pub fn can_continue_expr_unambiguously(&self) -> bool {
use AssocOp::*;
match self {
matches!(
self,
BitXor | // `{ 42 } ^ 3`
Assign | // `{ 42 } = { 42 }`
Divide | // `{ 42 } / 42`
@ -225,9 +226,8 @@ impl AssocOp {
As | // `{ 42 } as usize`
// Equal | // `{ 42 } == { 42 }` Accepting these here would regress incorrect
// NotEqual | // `{ 42 } != { 42 } struct literals parser recovery.
Colon => true, // `{ 42 }: usize`
_ => false,
}
Colon, // `{ 42 }: usize`
)
}
}