From: Kostya Shishkov Date: Tue, 11 Dec 2018 12:58:38 +0000 (+0100) Subject: byteio: update syntax X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=98428ee2d74f3475bc56bd8f317db44b67742b41 byteio: update syntax --- 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()) }