From 89ab8d9aca4eb79f567925f5fccd6a8967dd51e1 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 19 Aug 2017 00:34:44 +0100 Subject: [PATCH] fix a FIXME, break value is now stable --- src/element.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/element.rs b/src/element.rs index e0aebf8..75faec6 100644 --- a/src/element.rs +++ b/src/element.rs @@ -269,14 +269,12 @@ impl Element { /// Parse a document from an `EventReader`. pub fn from_reader(reader: &mut EventReader) -> Result { 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);