diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-06 21:13:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-06 22:06:16 +0200 |
| commit | fd417da04f7ca4b995de7f6510abafd3e9c31307 (patch) | |
| tree | 3675529c75ca7363701ac8ea306de2cc1d3cbcb3 /library/src/meta/document.rs | |
| parent | 168bdf35bd773e67343c965cb473492cc5cae9e7 (diff) | |
Improve value casting infrastructure
Diffstat (limited to 'library/src/meta/document.rs')
| -rw-r--r-- | library/src/meta/document.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/library/src/meta/document.rs b/library/src/meta/document.rs index 1ce900ed..db036e0a 100644 --- a/library/src/meta/document.rs +++ b/library/src/meta/document.rs @@ -78,12 +78,9 @@ impl LayoutRoot for DocumentElem { #[derive(Debug, Default, Clone, Hash)] pub struct Author(Vec<EcoString>); -cast_from_value! { +cast! { Author, + self => self.0.into_value(), v: EcoString => Self(vec![v]), v: Array => Self(v.into_iter().map(Value::cast).collect::<StrResult<_>>()?), } - -cast_to_value! { - v: Author => v.0.into() -} |
