Clear buf before parsing.

This commit is contained in:
2020-08-04 19:02:18 +02:00
parent a650454fa7
commit 3366e5e1a4

View File

@@ -37,6 +37,8 @@ fn main() -> Result<()> {
loop {
match reader.read_event(&mut buf) {
Ok(Event::Start(ref e)) if e.name() == b"localeDisplayNames" => {
buf.clear();
results.extend(parse::locale_display_names(&mut reader, &mut buf));
}
Err(e) => panic!("Error at position {}: {:?}", reader.buffer_position(), e),