From 624cf06f69e249bd968937a4e0cdde9cf62edf8c Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 29 Feb 2020 16:13:57 -0500 Subject: [PATCH] clippy --- src/atrule.rs | 4 ++-- src/css.rs | 2 +- src/lexer.rs | 2 +- src/lib.rs | 8 ++++---- src/mixin.rs | 4 ++-- src/selector.rs | 4 ++-- src/style.rs | 2 +- src/utils.rs | 8 ++++---- src/value/parse.rs | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/atrule.rs b/src/atrule.rs index 0a51beb..fc0614b 100644 --- a/src/atrule.rs +++ b/src/atrule.rs @@ -269,8 +269,8 @@ fn eat_unknown_atrule_body>( while let Some(expr) = eat_expr(toks, &scope, super_selector)? { match expr { Expr::AtRule(a) => stmts.push(Stmt::AtRule(a)), - Expr::Style(s) => stmts.push(Stmt::Style(*s)), - Expr::Styles(s) => stmts.extend(s.into_iter().map(Stmt::Style)), + Expr::Style(s) => stmts.push(Stmt::Style(s)), + Expr::Styles(s) => stmts.extend(s.into_iter().map(Box::new).map(Stmt::Style)), Expr::Include(s) => stmts.extend(s), Expr::MixinDecl(..) | Expr::FunctionDecl(..) | Expr::Debug(..) | Expr::Warn(..) => { todo!() diff --git a/src/css.rs b/src/css.rs index a45c096..8bd9386 100644 --- a/src/css.rs +++ b/src/css.rs @@ -79,7 +79,7 @@ impl Css { Stmt::Style(s) => vals .get_mut(0) .expect("expected block to exist") - .push_style(s), + .push_style(*s), Stmt::MultilineComment(s) => vals .get_mut(0) .expect("expected block to exist") diff --git a/src/lexer.rs b/src/lexer.rs index 33eedee..92ef571 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -139,7 +139,7 @@ impl<'a> Iterator for Lexer<'a> { if !v.is_ascii() { IS_UTF8.store(true, Ordering::Relaxed); } - TokenKind::Unknown(v.clone()) + TokenKind::Unknown(v) } }; self.pos.next_char(); diff --git a/src/lib.rs b/src/lib.rs index 3f6e040..3b65f94 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,7 +200,7 @@ pub struct StyleSheet(Vec); #[derive(Clone, Debug)] pub(crate) enum Stmt { /// A [`Style`](/grass/style/struct.Style) - Style(Style), + Style(Box