fix a FIXME, break value is now stable
This commit is contained in:
parent
4546db95fc
commit
89ab8d9aca
1 changed files with 2 additions and 4 deletions
|
@ -269,14 +269,12 @@ impl Element {
|
||||||
/// Parse a document from an `EventReader`.
|
/// Parse a document from an `EventReader`.
|
||||||
pub fn from_reader<R: BufRead>(reader: &mut EventReader<R>) -> Result<Element> {
|
pub fn from_reader<R: BufRead>(reader: &mut EventReader<R>) -> Result<Element> {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
let root: Element;
|
|
||||||
|
|
||||||
loop {
|
let root: Element = loop {
|
||||||
let e = reader.read_event(&mut buf)?;
|
let e = reader.read_event(&mut buf)?;
|
||||||
match e {
|
match e {
|
||||||
Event::Empty(ref e) | Event::Start(ref 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 build_element(e)?;
|
||||||
break;
|
|
||||||
},
|
},
|
||||||
Event::Eof => {
|
Event::Eof => {
|
||||||
bail!(ErrorKind::EndOfDocument);
|
bail!(ErrorKind::EndOfDocument);
|
||||||
|
|
Loading…
Reference in a new issue