Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/parser.rs')
| -rw-r--r-- | crates/parser/src/parser.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/parser/src/parser.rs b/crates/parser/src/parser.rs index ef413c6375..051461243a 100644 --- a/crates/parser/src/parser.rs +++ b/crates/parser/src/parser.rs @@ -250,12 +250,9 @@ impl<'t> Parser<'t> { /// Create an error node and consume the next token. pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) { - match self.current() { - T!['{'] | T!['}'] => { - self.error(message); - return; - } - _ => (), + if matches!(self.current(), T!['{'] | T!['}']) { + self.error(message); + return; } if self.at_ts(recovery) { |