From 07cb3a4ac762073d0a6b908d2b48c3230ea6254c Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sun, 19 Jan 2020 00:29:45 -0500 Subject: [PATCH] Remove clone from multiline comments --- src/main.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0698471..c060452 100644 --- a/src/main.rs +++ b/src/main.rs @@ -532,16 +532,15 @@ pub(crate) fn eat_expr>( let tok = toks .next() .expect("this must exist because we have already peeked"); - let s = if let TokenKind::MultilineComment(s) = &tok.kind { - s - } else { - unsafe { std::hint::unreachable_unchecked() } - }; devour_whitespace(toks); if values.is_empty() { - return Ok(Some(Expr::MultilineComment(s.clone()))); + let s = match tok.kind { + TokenKind::MultilineComment(s) => s, + _ => unsafe { std::hint::unreachable_unchecked() }, + }; + return Ok(Some(Expr::MultilineComment(s))); } else { - values.push(tok.clone()) + values.push(tok); } } TokenKind::AtRule(AtRule::Include) => {