This commit is contained in:
Noah Hellman 2022-11-27 23:59:01 +01:00
parent eaea5cf95c
commit fb1950233a

View file

@ -228,10 +228,8 @@ impl<'s> Parser<'s> {
.rposition(|(c, _)| *c == cont_new) .rposition(|(c, _)| *c == cont_new)
.and_then(|o| { .and_then(|o| {
matches!(dir, Dir::Close | Dir::Both).then(|| { matches!(dir, Dir::Close | Dir::Both).then(|| {
let (cont_open, e) = &mut self.openers[o]; let (_, e) = &mut self.openers[o];
assert_eq!(*cont_open, cont_new); if let Event::Enter(_, state_ev) = &mut self.events[*e] {
if let Event::Enter(cont_ev, state_ev) = &mut self.events[*e] {
assert_eq!(*cont_ev, cont_new);
*state_ev = OpenerState::Closed; *state_ev = OpenerState::Closed;
self.openers.drain(o..); self.openers.drain(o..);
Event::Exit(cont_new) Event::Exit(cont_new)