diff --git a/src/crc.rs b/src/crc.rs index 9e60e97cd..f1e20f2bd 100644 --- a/src/crc.rs +++ b/src/crc.rs @@ -167,7 +167,7 @@ impl CrcWriter { impl Write for CrcWriter { fn write(&mut self, buf: &[u8]) -> io::Result { - let amt = try!(self.inner.write(buf)); + let amt = self.inner.write(buf)?; self.crc.update(&buf[..amt]); Ok(amt) } diff --git a/src/zio.rs b/src/zio.rs index 1222a6c3e..a8acaaafc 100644 --- a/src/zio.rs +++ b/src/zio.rs @@ -241,7 +241,7 @@ impl Writer { // TODO: should manage this buffer not with `drain` but probably more of // a deque-like strategy. while self.buf.len() > 0 { - let n = try!(self.obj.as_mut().unwrap().write(&self.buf)); + let n = self.obj.as_mut().unwrap().write(&self.buf)?; if n == 0 { return Err(io::ErrorKind::WriteZero.into()); }