summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-27 11:58:17 +0200
committerLaurenz <laurmaedje@gmail.com>2023-03-27 12:12:57 +0200
commita5c88c19b300c64fafd6a19e3f5f2fe6422a7b67 (patch)
tree42192332e277624a35c6e3db568c0ff8196b582a /src/syntax/ast.rs
parent10d8fd966130f1e60d328b08a7fcce61961d6974 (diff)
Fix enum parsing and allow zero in numberings
Fixes #353.
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index bd8fa230..b064da88 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -681,7 +681,7 @@ node! {
impl EnumItem {
/// The explicit numbering, if any: `23.`.
- pub fn number(&self) -> Option<NonZeroUsize> {
+ pub fn number(&self) -> Option<usize> {
self.0.children().find_map(|node| match node.kind() {
SyntaxKind::EnumMarker => node.text().trim_end_matches('.').parse().ok(),
_ => Option::None,