Minify Parser.write()
This commit is contained in:
parent
44994487c6
commit
d260ef20e3
1 changed files with 3 additions and 11 deletions
|
@ -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> {
|
||||||
|
|
Loading…
Reference in a new issue