From b78b2866a8142d00e3b144e8701f68a464c06074 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Thu, 26 Jan 2023 21:55:12 +0100 Subject: [PATCH] fixup! inline fixup --- src/inline.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/inline.rs b/src/inline.rs index 058a989..8ceedb2 100644 --- a/src/inline.rs +++ b/src/inline.rs @@ -398,7 +398,7 @@ impl + Clone> Parser { *d == delim || matches!((d, delim), (Delim::Span(..), Delim::Span(..))) }) .and_then(|o| { - if !dir.can_close() { + if matches!(dir, Dir::Open) { return None; } let (d, e) = self.openers[o]; @@ -473,7 +473,7 @@ impl + Clone> Parser { event_closer }) .or_else(|| { - if !dir.can_open() { + if matches!(dir, Dir::Close) { return None; } self.openers.push((delim, self.events.len())); @@ -584,16 +584,6 @@ enum Dir { Both, } -impl Dir { - fn can_open(self) -> bool { - matches!(self, Dir::Open | Dir::Both) - } - - fn can_close(self) -> bool { - matches!(self, Dir::Close | Dir::Both) - } -} - impl Delim { fn from_token(kind: lex::Kind) -> Option<(Self, Dir)> { use Delim::*;