byteio: update syntax
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 11 Dec 2018 12:58:38 +0000 (13:58 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 11 Dec 2018 12:58:38 +0000 (13:58 +0100)
src/io/byteio.rs

index e172a325d223e19ff512a6f553b9c4aa083293f1..966169cdefa00756767c79a500cd64ef70499064 100644 (file)
@@ -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())
         }