summaryrefslogtreecommitdiff
path: root/src/model/cast.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-20 23:32:30 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-20 23:32:30 +0100
commitddada4509729b0b8dcc394737d7eec588df51040 (patch)
tree828a84eea9488f14878bf0ca16ee121e20a9de29 /src/model/cast.rs
parent46d469f4bee6afd6b0d7dfdb3f095b98b18ac5f9 (diff)
Tracepoints for show rules
Diffstat (limited to 'src/model/cast.rs')
-rw-r--r--src/model/cast.rs7
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! {