summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-17 11:32:15 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-17 11:45:57 +0100
commit312197b276748e1a17258ad21837850f582a467c (patch)
tree3fd0c078a2673a98b74bc12b4d654a4c143b4e1f /src/syntax
parente8435df5ec718e8ecc8a2ad48e4eb3ddd1f92a72 (diff)
Counters
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 8e48358d..760a6499 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -12,6 +12,7 @@ use super::{
is_id_continue, is_id_start, is_newline, split_newlines, Span, SyntaxKind, SyntaxNode,
};
use crate::geom::{AbsUnit, AngleUnit};
+use crate::util::NonZeroExt;
/// A typed AST node.
pub trait AstNode: Sized {
@@ -641,7 +642,7 @@ impl Heading {
.children()
.find(|node| node.kind() == SyntaxKind::HeadingMarker)
.and_then(|node| node.len().try_into().ok())
- .unwrap_or(NonZeroUsize::new(1).unwrap())
+ .unwrap_or(NonZeroUsize::ONE)
}
}