1
Fork 0

Rollup merge of #107467 - WaffleLapkin:uneq, r=oli-obk

Improve enum checks

Some light refactoring.
This commit is contained in:
Guillaume Gomez 2023-01-31 23:38:52 +01:00 committed by GitHub
commit 53bb6322db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 278 additions and 260 deletions

View file

@ -503,7 +503,7 @@ impl TtParser {
mp.push_match(metavar_idx, seq_depth, MatchedSeq(vec![]));
}
if op == KleeneOp::ZeroOrMore || op == KleeneOp::ZeroOrOne {
if matches!(op, KleeneOp::ZeroOrMore | KleeneOp::ZeroOrOne) {
// Try zero matches of this sequence, by skipping over it.
self.cur_mps.push(MatcherPos {
idx: idx_first_after,