need_more -> ready
This commit is contained in:
parent
e798dc9c28
commit
463f146623
1 changed files with 3 additions and 3 deletions
|
@ -323,7 +323,7 @@ impl<'s> Iterator for Parser<'s> {
|
|||
type Item = Event;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let mut need_more = false;
|
||||
let mut ready = true;
|
||||
while self.events.is_empty()
|
||||
|| !self.openers.is_empty()
|
||||
|| !matches!(self.state, State::None)
|
||||
|
@ -336,12 +336,12 @@ impl<'s> Iterator for Parser<'s> {
|
|||
self.events.push_back(ev);
|
||||
dbg!(&self.events, &self.state);
|
||||
} else {
|
||||
need_more = true;
|
||||
ready = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if self.last || !need_more {
|
||||
if self.last || ready {
|
||||
self.events
|
||||
.pop_front()
|
||||
.map(|e| {
|
||||
|
|
Loading…
Reference in a new issue