Skip to content

Commit 829a98a

Browse files
committed
match
1 parent ae24f83 commit 829a98a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/parser/src/lexer.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ where
352352
}
353353

354354
// 1e6 for example:
355-
if matches!(self.window[0], Some('e' | 'E')) {
355+
if let Some('e' | 'E') = self.window[0] {
356356
if self.window[1] == Some('_') {
357357
return Err(LexicalError {
358358
error: LexicalErrorType::OtherError("Invalid Syntax".to_owned()),
@@ -1256,10 +1256,7 @@ where
12561256
' ' | '\t' | '\x0C' => {
12571257
// Skip whitespaces
12581258
self.next_char();
1259-
while self.window[0] == Some(' ')
1260-
|| self.window[0] == Some('\t')
1261-
|| self.window[0] == Some('\x0C')
1262-
{
1259+
while let Some(' ' | '\t' | '\x0C') = self.window[0] {
12631260
self.next_char();
12641261
}
12651262
}

0 commit comments

Comments
 (0)