Skip to content

Instantly share code, notes, and snippets.

View gist:de8bcf7477aa1e3a6e06
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)