Merge branch 'break-value' into 'master'

Fix a FIXME, break value is now stable

See merge request !17
This commit is contained in:
lumi 2017-08-20 15:02:19 +00:00
commit 437973edf8

View file

@ -269,14 +269,12 @@ impl Element {
/// Parse a document from an `EventReader`.
pub fn from_reader<R: BufRead>(reader: &mut EventReader<R>) -> Result<Element> {
let mut buf = Vec::new();
let root: Element;
loop {
let root: Element = loop {
let e = reader.read_event(&mut buf)?;
match e {
Event::Empty(ref e) | Event::Start(ref e) => {
root = build_element(e)?; // FIXME: could be break build_element(e)? when break value is stable
break;
break build_element(e)?;
},
Event::Eof => {
bail!(ErrorKind::EndOfDocument);