From 98428ee2d74f3475bc56bd8f317db44b67742b41 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 11 Dec 2018 13:58:38 +0100 Subject: [PATCH] byteio: update syntax --- src/io/byteio.rs | 4 ++-- 1 file 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()) } -- 2.39.5