diff options
Diffstat (limited to 'src/eval/function.rs')
| -rw-r--r-- | src/eval/function.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/eval/function.rs b/src/eval/function.rs index f18af05e..85608ca1 100644 --- a/src/eval/function.rs +++ b/src/eval/function.rs @@ -1,5 +1,4 @@ use std::fmt::{self, Debug, Display, Formatter, Write}; -use std::ops::Deref; use std::rc::Rc; use super::{Cast, EvalContext, Str, Value}; @@ -34,13 +33,10 @@ impl Function { pub fn name(&self) -> Option<&EcoString> { self.repr.name.as_ref() } -} - -impl Deref for Function { - type Target = Func; - fn deref(&self) -> &Self::Target { - &self.repr.func + /// Call the function in the context with the arguments. + pub fn call(&self, ctx: &mut EvalContext, args: &mut Arguments) -> TypResult<Value> { + (&self.repr.func)(ctx, args) } } |
