From 4883eea25200ba74132fbe2dc905e447eae7f4dc Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 31 Aug 2017 02:48:59 +0000 Subject: [PATCH] libproto: simplify (NFC). --- artiq/firmware/libproto/rpc_proto.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/artiq/firmware/libproto/rpc_proto.rs b/artiq/firmware/libproto/rpc_proto.rs index bd1e190f4..8ff7693a9 100644 --- a/artiq/firmware/libproto/rpc_proto.rs +++ b/artiq/firmware/libproto/rpc_proto.rs @@ -8,9 +8,9 @@ unsafe fn recv_value(reader: &mut Read, tag: Tag, data: &mut *mut (), alloc: &Fn(usize) -> io::Result<*mut ()>) -> io::Result<()> { macro_rules! consume_value { ($ty:ty, |$ptr:ident| $map:expr) => ({ - let ptr = (*data) as *mut $ty; - *data = ptr.offset(1) as *mut (); - (|$ptr: *mut $ty| $map)(ptr) + let $ptr = (*data) as *mut $ty; + *data = $ptr.offset(1) as *mut (); + $map }) } @@ -87,9 +87,9 @@ pub fn recv_return(reader: &mut Read, tag_bytes: &[u8], data: *mut (), unsafe fn send_value(writer: &mut Write, tag: Tag, data: &mut *const ()) -> io::Result<()> { macro_rules! consume_value { ($ty:ty, |$ptr:ident| $map:expr) => ({ - let ptr = (*data) as *const $ty; - *data = ptr.offset(1) as *const (); - (|$ptr: *const $ty| $map)(ptr) + let $ptr = (*data) as *const $ty; + *data = $ptr.offset(1) as *const (); + $map }) }