Clear buf before parsing.
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user