From 9fda623b02b2a0a9e9cdf806d9945d0759c8bf01 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Wed, 23 Feb 2022 20:06:48 +0100 Subject: Code Review: That's just like your struct, man. --- src/syntax/ast.rs | 2 +- src/syntax/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/syntax') diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index 7992f9de..10e5ec70 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -60,7 +60,7 @@ impl Markup { /// The markup nodes. pub fn nodes(&self) -> impl Iterator + '_ { self.0.children().filter_map(|node| match node.kind() { - NodeKind::Space(n) if *n > 1 => Some(MarkupNode::Parbreak), + NodeKind::Space(2 ..) => Some(MarkupNode::Parbreak), NodeKind::Space(_) => Some(MarkupNode::Space), NodeKind::Linebreak => Some(MarkupNode::Linebreak), NodeKind::Text(s) | NodeKind::TextInLine(s) => { diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index fc98bb34..85f2013c 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -757,7 +757,7 @@ impl NodeKind { /// Whether this node is `at_start` given the previous value of the property. pub fn is_at_start(&self, prev: bool) -> bool { match self { - Self::Space(n) if *n > 0 => true, + Self::Space(1 ..) => true, Self::Space(_) | Self::LineComment | Self::BlockComment => prev, _ => false, } @@ -858,7 +858,7 @@ impl NodeKind { Self::Include => "keyword `include`", Self::From => "keyword `from`", Self::Markup(_) => "markup", - Self::Space(n) if *n > 1 => "paragraph break", + Self::Space(2 ..) => "paragraph break", Self::Space(_) => "space", Self::Linebreak => "forced linebreak", Self::Text(_) | Self::TextInLine(_) => "text", -- cgit v1.2.3