summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-06-10 23:53:20 +0200
committerLaurenz <laurmaedje@gmail.com>2022-06-10 23:54:16 +0200
commited6550fdb08eae92bffab6b6b137b1e0eebf62c6 (patch)
tree74152a38f7aa2ed2ac2fa190e81494422700ca36 /src/library/structure
parent6aff11057bc88257c9383137952bb41b5b85c3dc (diff)
Bump dependencies
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(),
+ )),
}
}
}