diff --git a/src/atrule/function.rs b/src/atrule/function.rs index fe57a9a..87cb5a5 100644 --- a/src/atrule/function.rs +++ b/src/atrule/function.rs @@ -72,7 +72,7 @@ impl Function { for (idx, arg) in self.args.0.iter().enumerate() { if arg.is_variadic { let span = args.span(); - let arg_list = Value::ArgList(args.get_variadic(&mut scope, super_selector)?); + let arg_list = Value::ArgList(args.get_variadic(&scope, super_selector)?); scope.insert_var( &arg.name, Spanned { @@ -82,14 +82,14 @@ impl Function { )?; break; } - let val = match args.get_positional(idx, &mut scope, super_selector) { + let val = match args.get_positional(idx, &scope, super_selector) { Some(v) => v?, - None => match args.get_named(arg.name.clone(), &mut scope, super_selector) { + None => match args.get_named(arg.name.clone(), &scope, super_selector) { Some(v) => v?, None => match &arg.default { Some(v) => Value::from_tokens( &mut v.iter().cloned().peekmore(), - &mut scope, + &scope, super_selector, )?, None => { diff --git a/src/atrule/mixin.rs b/src/atrule/mixin.rs index 9fb14d8..779d7d8 100644 --- a/src/atrule/mixin.rs +++ b/src/atrule/mixin.rs @@ -132,7 +132,7 @@ impl Mixin { stmts.extend(i.eval(&mut self.scope.clone(), super_selector, content)?) } AtRule::Content => { - stmts.extend(content.unwrap_or_default().into_iter().cloned()); + stmts.extend(content.unwrap_or_default().iter().cloned()); } AtRule::Return(..) => { return Err(("This at-rule is not allowed here.", span).into()) diff --git a/src/atrule/parse.rs b/src/atrule/parse.rs index e93dc69..609b95d 100644 --- a/src/atrule/parse.rs +++ b/src/atrule/parse.rs @@ -135,7 +135,7 @@ pub(crate) fn ruleset_eval>( Stmt::AtRule(AtRule::If(i)) => stmts.extend(i.eval(scope, super_selector, content)?), Stmt::AtRule(AtRule::Content) => { if let Some(c) = content { - stmts.extend(c.into_iter().cloned()); + stmts.extend(c.iter().cloned()); } else { return Err(( "@content is only allowed within mixin declarations.", diff --git a/src/color/mod.rs b/src/color/mod.rs index 484bb69..65d0fb8 100644 --- a/src/color/mod.rs +++ b/src/color/mod.rs @@ -500,7 +500,7 @@ fn repr(red: &Number, green: &Number, blue: &Number, alpha: &Number) -> String { if alpha < &Number::one() { format!("rgba({}, {}, {}, {})", red, green, blue, alpha) } else if let Some(c) = NAMED_COLORS.get_by_right(&[red, green, blue, 0xFF]) { - format!("{}", c) + c.to_string() } else { format!("#{:0>2x}{:0>2x}{:0>2x}", red, green, blue) } diff --git a/src/stylesheet.rs b/src/stylesheet.rs index 704f888..d2c8732 100644 --- a/src/stylesheet.rs +++ b/src/stylesheet.rs @@ -106,7 +106,7 @@ impl StyleSheet { #[cfg(not(feature = "wasm"))] pub fn from_path(p: &str) -> SassResult { let mut map = CodeMap::new(); - let file = map.add_file(p.clone().into(), String::from_utf8(fs::read(p.clone())?)?); + let file = map.add_file(p.into(), String::from_utf8(fs::read(p)?)?); Css::from_stylesheet(StyleSheet( StyleSheetParser { lexer: Lexer::new(&file).peekmore(),