summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
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)
}
}