Skip to content

Instantly share code, notes, and snippets.

why does the for-loop consume `evts`:
fn next_start_elem<R: Read>(evts: &mut Events<R>) -> Result<String, Error> {
for evt in evts {
if let XmlEvent::StartElement{ name, .. } = try!(evt) {
return Ok(name.local_name);
}
}
let _ = evts.text_position();
Err(Error::UnexpectedEof)