diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-06 01:31:32 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-06 16:13:14 +0100 |
| commit | 0a5640b55f4a34a1f96859663449b0cabfb08c87 (patch) | |
| tree | 1f0a58a14a6c4cb31551ff0e3baf868ddcf17743 /compiler/rustc_ast/src/util/parser.rs | |
| parent | 3cd3bbecc5e498465e89be8a33d2936aaebed0bf (diff) | |
| download | rust-0a5640b55f4a34a1f96859663449b0cabfb08c87.tar.gz rust-0a5640b55f4a34a1f96859663449b0cabfb08c87.zip | |
use matches!() macro in more places
Diffstat (limited to 'compiler/rustc_ast/src/util/parser.rs')
| -rw-r--r-- | compiler/rustc_ast/src/util/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_ast/src/util/parser.rs b/compiler/rustc_ast/src/util/parser.rs index 500c97e65ef..742a7d1d2df 100644 --- a/compiler/rustc_ast/src/util/parser.rs +++ b/compiler/rustc_ast/src/util/parser.rs @@ -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` + ) } } |
