Minify Parser.read()

This commit is contained in:
Matthias Beyer 2015-11-01 18:01:32 +01:00
parent 2c940d0ca8
commit 44994487c6

View file

@ -117,18 +117,10 @@ impl<HP, DP> Parser<HP, DP> where
let (header, data) = divided.ok().unwrap(); let (header, data) = divided.ok().unwrap();
let h_parseres = self.headerp.read(header); let h_parseres = try!(self.headerp.read(header));
let d_parseres = self.datap.read(data); let d_parseres = try!(self.datap.read(data));
if h_parseres.is_err() { Ok((h_parseres, d_parseres))
return Err(h_parseres.err().unwrap());
}
if d_parseres.is_err() {
return Err(d_parseres.err().unwrap());
}
Ok((h_parseres.ok().unwrap(), d_parseres.ok().unwrap()))
} }
fn write<FD>(&self, tpl : (FileHeaderData, FD)) -> Result<String, ParserError> fn write<FD>(&self, tpl : (FileHeaderData, FD)) -> Result<String, ParserError>