summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/structure')
-rw-r--r--src/library/structure/list.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library/structure/list.rs b/src/library/structure/list.rs
index 015ef520..c4167cf9 100644
--- a/src/library/structure/list.rs
+++ b/src/library/structure/list.rs
@@ -238,6 +238,7 @@ impl Cast<Spanned<Value>> for Label {
fn cast(value: Spanned<Value>) -> StrResult<Self> {
match value.v {
+ Value::None => Ok(Self::Content(Content::Empty)),
Value::Str(pattern) => {
let mut s = Scanner::new(&pattern);
let mut prefix;
@@ -258,7 +259,10 @@ impl Cast<Spanned<Value>> for Label {
}
Value::Content(v) => Ok(Self::Content(v)),
Value::Func(v) => Ok(Self::Func(v, value.span)),
- _ => Err("expected pattern, content or function")?,
+ v => Err(format!(
+ "expected string, content or function, found {}",
+ v.type_name(),
+ )),
}
}
}