diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index e0d93e5..5cc24af 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -209,12 +209,12 @@ fn get_function(mut args: CallArgs, parser: &mut Parser<'_>) -> SassResult) -> SassResult { let func = match parser.arg(&mut args, 0, "function")? { - Value::Function(f) => f, + Value::FunctionRef(f) => f, v => { return Err(( format!( diff --git a/src/parse/value/eval.rs b/src/parse/value/eval.rs index 6caf401..b516a71 100644 --- a/src/parse/value/eval.rs +++ b/src/parse/value/eval.rs @@ -160,7 +160,7 @@ impl<'a, 'b: 'a> ValueVisitor<'a, 'b> { v => panic!("{:?}", v), }; Ok(match left { - Value::Map(..) | Value::Function(..) => { + Value::Map(..) | Value::FunctionRef(..) => { return Err(( format!("{} isn't a valid CSS value.", left.inspect(self.span)?), self.span, @@ -223,7 +223,7 @@ impl<'a, 'b: 'a> ValueVisitor<'a, 'b> { format!("{}{}{}", num, unit, right.to_css_string(self.span)?), QuoteKind::None, ), - Value::Map(..) | Value::Function(..) => { + Value::Map(..) | Value::FunctionRef(..) => { return Err(( format!("{} isn't a valid CSS value.", right.inspect(self.span)?), self.span, @@ -329,7 +329,7 @@ impl<'a, 'b: 'a> ValueVisitor<'a, 'b> { format!("{}{}-{}", num, unit, right.to_css_string(self.span)?), QuoteKind::None, ), - Value::Map(..) | Value::Function(..) => { + Value::Map(..) | Value::FunctionRef(..) => { return Err(( format!("{} isn't a valid CSS value.", right.inspect(self.span)?), self.span, @@ -517,7 +517,7 @@ impl<'a, 'b: 'a> ValueVisitor<'a, 'b> { QuoteKind::None, ), Value::Null => Value::String(format!("{}{}/", num, unit), QuoteKind::None), - Value::Map(..) | Value::Function(..) => { + Value::Map(..) | Value::FunctionRef(..) => { return Err(( format!("{} isn't a valid CSS value.", right.inspect(self.span)?), self.span, diff --git a/src/value/mod.rs b/src/value/mod.rs index 795d2c9..5b939aa 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -36,7 +36,7 @@ pub(crate) enum Value { Map(SassMap), ArgList(Vec>), /// Returned by `get-function()` - Function(SassFunction), + FunctionRef(SassFunction), } fn visit_quoted_string(buf: &mut String, force_double_quote: bool, string: &str) { @@ -130,7 +130,7 @@ impl Value { } _ => Cow::owned(format!("{}{}", num, unit)), }, - Self::Map(..) | Self::Function(..) => { + Self::Map(..) | Self::FunctionRef(..) => { return Err(( format!("{} isn't a valid CSS value.", self.inspect(span)?), span, @@ -222,7 +222,7 @@ impl Value { Self::String(..) | Self::Important => "string", Self::Dimension(..) => "number", Self::List(..) => "list", - Self::Function(..) => "function", + Self::FunctionRef(..) => "function", Self::ArgList(..) => "arglist", Self::True | Self::False => "bool", Self::Null => "null", @@ -277,7 +277,7 @@ impl Value { .join(sep.as_str()), ), }), - Value::Function(f) => Cow::owned(format!("get-function(\"{}\")", f.name())), + Value::FunctionRef(f) => Cow::owned(format!("get-function(\"{}\")", f.name())), Value::Null => Cow::const_str("null"), Value::Map(map) => Cow::owned(format!( "({})",