Minify Parser.write()

This commit is contained in:
Matthias Beyer 2015-11-01 18:02:40 +01:00
parent 44994487c6
commit d260ef20e3

View file

@ -128,18 +128,10 @@ impl<HP, DP> Parser<HP, DP> where
DP: FileDataParser<FD> DP: FileDataParser<FD>
{ {
let (header, data) = tpl; let (header, data) = tpl;
let h_text = self.headerp.write(&header); let h_text = try!(self.headerp.write(&header));
let d_text = self.datap.write(&data); let d_text = try!(self.datap.write(&data));
if h_text.is_err() { Ok(h_text + &d_text[..])
return Err(h_text.err().unwrap());
}
if d_text.is_err() {
return Err(d_text.err().unwrap());
}
Ok(h_text.ok().unwrap() + &d_text.ok().unwrap()[..])
} }
fn divide_text(&self, text: &String) -> Result<TextTpl, ParserError> { fn divide_text(&self, text: &String) -> Result<TextTpl, ParserError> {