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,12 +153,17 @@ impl<R: Read> Parser<R> {
});
}
EventParse::ReachedEnd => {
if self.inner_opens == 0 {
return Ok(Event::Done);
} else {
return Err(Error::UnclosedInnerNode(
self.total_bytes_processed + valid_count,
));
// 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 {
return Err(Error::UnclosedInnerNode(
self.total_bytes_processed + valid_count,
));
}
}
}
EventParse::IncompleteData => {