Fixed silly bug in data tree parser.

This commit is contained in:
Nathan Vegdahl 2020-01-05 22:53:47 +09:00
parent 1f4947e895
commit 7f1b1d2382

View File

@ -153,6 +153,10 @@ impl<R: Read> Parser<R> {
});
}
EventParse::ReachedEnd => {
// If we're at the end, make sure we're in a valid
// state and finish. Otherwise, let things keep
// going.
if self.eof {
if self.inner_opens == 0 {
return Ok(Event::Done);
} else {
@ -161,6 +165,7 @@ impl<R: Read> Parser<R> {
));
}
}
}
EventParse::IncompleteData => {
// If we're at the end, it's a problem.
// Otherwise, wait for more data.