diff --git a/src/builtin/string.rs b/src/builtin/string.rs index 539b037..924b4bc 100644 --- a/src/builtin/string.rs +++ b/src/builtin/string.rs @@ -55,7 +55,6 @@ pub(crate) fn register(f: &mut HashMap) { Box::new(|args, _| { max_args!(args, 1); match arg!(args, 0, "string") { - Value::Ident(i, _) if i.is_empty() => Ok(Value::Null), i @ Value::Ident(..) => Ok(i.unquote()), v => Err(format!("$string: {} is not a string.", v).into()), } diff --git a/src/value/mod.rs b/src/value/mod.rs index 1eaca86..e5cefd5 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -99,7 +99,11 @@ impl Display for Value { impl Value { pub fn is_null(&self) -> bool { - self == &Value::Null + match self { + &Value::Null => true, + Value::Ident(i, QuoteKind::None) if i.is_empty() => true, + _ => false + } } pub fn is_true(&self) -> SassResult {