diff options
author | Kostya Shishkov <[email protected]> | 2018-12-11 13:58:38 +0100 |
---|---|---|
committer | Kostya Shishkov <[email protected]> | 2018-12-11 13:58:38 +0100 |
commit | 98428ee2d74f3475bc56bd8f317db44b67742b41 (patch) | |
tree | 81d862c38ccdd80dc809b543d2e75e4d6ea3654f /src | |
parent | 1f7e9371e2ec548b6821bb01ce7ba82c4cd8068d (diff) |
byteio: update syntax
Diffstat (limited to 'src')
-rw-r--r-- | src/io/byteio.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/io/byteio.rs b/src/io/byteio.rs index e172a32..966169c 100644 --- a/src/io/byteio.rs +++ b/src/io/byteio.rs @@ -48,7 +48,7 @@ pub struct FileReader<'a> { macro_rules! read_int { ($s: ident, $inttype: ty, $size: expr, $which: ident) => ({ let mut buf = [0; $size]; - try!($s.read_buf(&mut buf)); + $s.read_buf(&mut buf)?; unsafe { Ok((*(buf.as_ptr() as *const $inttype)).$which()) } @@ -58,7 +58,7 @@ macro_rules! read_int { macro_rules! peek_int { ($s: ident, $inttype: ty, $size: expr, $which: ident) => ({ let mut buf = [0; $size]; - try!($s.peek_buf(&mut buf)); + $s.peek_buf(&mut buf)?; unsafe { Ok((*(buf.as_ptr() as *const $inttype)).$which()) } |