X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fio%2Fbyteio.rs;h=966169cdefa00756767c79a500cd64ef70499064;hb=b74ff9fac35d41737d71d97227fad233aa4a4b49;hp=e172a325d223e19ff512a6f553b9c4aa083293f1;hpb=5eb3cc6035c6c247ffd7e0ac2e3f0f49f1e2ee7b;p=nihav.git 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()) }