From ed6550fdb08eae92bffab6b6b137b1e0eebf62c6 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 10 Jun 2022 23:53:20 +0200 Subject: Bump dependencies --- src/library/structure/list.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/library/structure') 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> for Label { fn cast(value: Spanned) -> StrResult { 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> 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(), + )), } } } -- cgit v1.2.3