clippy
This commit is contained in:
parent
8711e61398
commit
269f37034a
@ -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 => {
|
||||
|
@ -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())
|
||||
|
@ -135,7 +135,7 @@ pub(crate) fn ruleset_eval<I: Iterator<Item = Token>>(
|
||||
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.",
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ impl StyleSheet {
|
||||
#[cfg(not(feature = "wasm"))]
|
||||
pub fn from_path(p: &str) -> SassResult<String> {
|
||||
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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user