prefer match over if let .. else ..

This commit is contained in:
ConnorSkees 2020-05-02 12:25:53 -04:00
parent 2cc655aa61
commit 2e8126af13

View File

@ -185,10 +185,9 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
content: Option<&[Spanned<Stmt>]>,
) -> SassResult<Option<Spanned<Expr>>> {
let mut values = Vec::with_capacity(5);
let mut span = if let Some(tok) = toks.peek() {
tok.pos()
} else {
return Ok(None);
let mut span = match toks.peek() {
Some(tok) => tok.pos(),
None => return Ok(None),
};
while let Some(tok) = toks.peek() {
span = span.merge(tok.pos());