remove unwrap from next_is_hyphen()

This commit is contained in:
Connor Skees 2020-07-25 00:54:59 -04:00
parent 91b000ac0d
commit f2cd74528b

View File

@ -333,8 +333,11 @@ impl<'a> Parser<'a> {
} }
fn next_is_hypen(&mut self) -> bool { fn next_is_hypen(&mut self) -> bool {
self.toks.peek_forward(1).is_some() if let Some(Token { kind, .. }) = self.toks.peek_forward(1) {
&& matches!(self.toks.peek().unwrap().kind, '-' | '_' | 'a'..='z' | 'A'..='Z') matches!(kind, '-' | '_' | 'a'..='z' | 'A'..='Z')
} else {
false
}
} }
fn parse_intermediate_value(&mut self) -> Option<SassResult<Spanned<IntermediateValue>>> { fn parse_intermediate_value(&mut self) -> Option<SassResult<Spanned<IntermediateValue>>> {