diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index ac571c0..1856eb9 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -204,9 +204,9 @@ fn get_function(mut args: CallArgs, scope: &Scope, super_selector: &Selector) -> node: name.clone(), span: args.span(), }) { - Ok(f) => SassFunction::UserDefined(Box::new(f), name), + Ok(f) => SassFunction::UserDefined(Box::new(f), name.into()), Err(..) => match GLOBAL_FUNCTIONS.get(name.as_str()) { - Some(f) => SassFunction::Builtin(f.clone(), name), + Some(f) => SassFunction::Builtin(f.clone(), name.into()), None => return Err((format!("Function not found: {}", name), args.span()).into()), }, }; diff --git a/src/value/sass_function.rs b/src/value/sass_function.rs index 18eb671..597348b 100644 --- a/src/value/sass_function.rs +++ b/src/value/sass_function.rs @@ -14,6 +14,7 @@ use std::fmt; use crate::args::CallArgs; use crate::atrule::Function; use crate::builtin::Builtin; +use crate::common::Identifier; use crate::error::SassResult; use crate::scope::Scope; use crate::selector::Selector; @@ -27,15 +28,15 @@ use crate::value::Value; /// for use in the builtin function `inspect()` #[derive(Clone)] pub(crate) enum SassFunction { - Builtin(Builtin, String), - UserDefined(Box, String), + Builtin(Builtin, Identifier), + UserDefined(Box, Identifier), } impl SassFunction { /// Get the name of the function referenced /// /// Used mainly in debugging and `inspect()` - pub fn name(&self) -> &str { + pub fn name(&self) -> &Identifier { match self { Self::Builtin(_, name) => name, Self::UserDefined(_, name) => name,