Skip to content

Commit ed76e57

Browse files
committed
Consolidate logic in match
This was previously not possible due to lexical lifetimes.
1 parent 6c69040 commit ed76e57

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/rules_and_declarations.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,10 @@ where
384384
Some(b'@') => {
385385
match self.input.next_including_whitespace_and_comments() {
386386
Ok(&Token::AtKeyword(ref name)) => at_keyword = Some(name.clone()),
387-
_ => at_keyword = None,
388-
}
389-
// FIXME: move this back inside `match` when lifetimes are non-lexical
390-
if at_keyword.is_none() {
391-
self.input.reset(&start)
387+
_ => {
388+
at_keyword = None;
389+
self.input.reset(&start)
390+
},
392391
}
393392
}
394393
Some(_) => at_keyword = None,
@@ -454,11 +453,10 @@ where
454453
if input.next_byte() == Some(b'@') {
455454
match *input.next_including_whitespace_and_comments()? {
456455
Token::AtKeyword(ref name) => at_keyword = Some(name.clone()),
457-
_ => at_keyword = None,
458-
}
459-
// FIXME: move this back inside `match` when lifetimes are non-lexical
460-
if at_keyword.is_none() {
461-
input.reset(&start)
456+
_ => {
457+
at_keyword = None;
458+
input.reset(&start)
459+
},
462460
}
463461
} else {
464462
at_keyword = None

0 commit comments

Comments
 (0)