From 2e8126af1335a922c48153e1be2a18e7188ca021 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 2 May 2020 12:25:53 -0400 Subject: [PATCH] prefer match over if let .. else .. --- src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 75ff116..f88b408 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,10 +185,9 @@ pub(crate) fn eat_expr>( content: Option<&[Spanned]>, ) -> SassResult>> { 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());