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::*;