diff options
Diffstat (limited to 'src/model/cast.rs')
| -rw-r--r-- | src/model/cast.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/model/cast.rs b/src/model/cast.rs index d2e10a1f..d5b4893d 100644 --- a/src/model/cast.rs +++ b/src/model/cast.rs @@ -194,7 +194,12 @@ castable! { Value::None => Self::Content(Content::empty()), Value::Str(text) => Self::Content(item!(text)(text.into())), Value::Content(content) => Self::Content(content), - Value::Func(func) => Self::Func(func), + Value::Func(func) => { + if func.argc().map_or(false, |count| count != 1) { + Err("function must have exactly one parameter")? + } + Self::Func(func) + }, } dynamic! { |
