From a5c88c19b300c64fafd6a19e3f5f2fe6422a7b67 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 27 Mar 2023 11:58:17 +0200 Subject: Fix enum parsing and allow zero in numberings Fixes #353. --- library/src/layout/enum.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'library/src/layout/enum.rs') diff --git a/library/src/layout/enum.rs b/library/src/layout/enum.rs index 1be57d4c..ec4fbc18 100644 --- a/library/src/layout/enum.rs +++ b/library/src/layout/enum.rs @@ -100,8 +100,8 @@ pub struct EnumElem { /// [Ahead], /// ) /// ``` - #[default(NonZeroUsize::ONE)] - pub start: NonZeroUsize, + #[default(1)] + pub start: usize, /// Whether to display the full numbering, including the numbers of /// all parent enumerations. @@ -225,7 +225,7 @@ impl Layout for EnumElem { pub struct EnumItem { /// The item's number. #[positional] - pub number: Option, + pub number: Option, /// The item's body. #[required] @@ -245,11 +245,11 @@ cast_from_value! { v: Content => v.to::().cloned().unwrap_or_else(|| Self::new(v.clone())), } -struct Parent(NonZeroUsize); +struct Parent(usize); cast_from_value! { Parent, - v: NonZeroUsize => Self(v), + v: usize => Self(v), } cast_to_value! { @@ -257,7 +257,7 @@ cast_to_value! { } impl Fold for Parent { - type Output = Vec; + type Output = Vec; fn fold(self, mut outer: Self::Output) -> Self::Output { outer.push(self.0); -- cgit v1.2.3