diff --git a/src/storage/parser.rs b/src/storage/parser.rs index 83760e42..ae6198a3 100644 --- a/src/storage/parser.rs +++ b/src/storage/parser.rs @@ -128,18 +128,10 @@ impl Parser where DP: FileDataParser { let (header, data) = tpl; - let h_text = self.headerp.write(&header); - let d_text = self.datap.write(&data); + let h_text = try!(self.headerp.write(&header)); + let d_text = try!(self.datap.write(&data)); - if h_text.is_err() { - 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()[..]) + Ok(h_text + &d_text[..]) } fn divide_text(&self, text: &String) -> Result {