Skip to content

Commit

Permalink
Remove last uses of try!
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Aug 26, 2019
1 parent 660035c commit bf47471
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl<W: Write> CrcWriter<W> {

impl<W: Write> Write for CrcWriter<W> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let amt = try!(self.inner.write(buf));
let amt = self.inner.write(buf)?;
self.crc.update(&buf[..amt]);
Ok(amt)
}
Expand Down
2 changes: 1 addition & 1 deletion src/zio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl<W: Write, D: Ops> Writer<W, D> {
// 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());
}
Expand Down

0 comments on commit bf47471

Please sign in to comment.