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())
}
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())
}