Skip to content

Commit 6095f88

Browse files
kth496Snowapril
andcommitted
Simplify boolean matching
Co-authored-by: Snowapril <sinjihng@gmail.com>
1 parent 5fd9fc4 commit 6095f88

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

parser/src/lexer.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,16 +576,14 @@ where
576576
}
577577
}
578578
None => {
579-
return match triple_quoted {
580-
true => Err(LexicalError {
581-
error: LexicalErrorType::Eof,
582-
location: self.get_pos(),
583-
}),
584-
false => Err(LexicalError {
585-
error: LexicalErrorType::StringError,
586-
location: self.get_pos(),
587-
}),
588-
}
579+
return Err(LexicalError {
580+
error: if triple_quoted {
581+
LexicalErrorType::Eof
582+
} else {
583+
LexicalErrorType::StringError
584+
},
585+
location: self.get_pos(),
586+
});
589587
}
590588
}
591589
}

0 commit comments

Comments
 (0)