diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-12-16 10:17:21 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-20 07:05:04 -0800 |
commit | 7e7a9ed321c7a173cacaac7647e21dbe119a6eb7 (patch) | |
tree | 99991f4770e28498db218b040fd9b4dd856c4226 /src | |
parent | 7d0058222566b14c07c7422d6212e0e789e565e1 (diff) | |
download | nix-7e7a9ed321c7a173cacaac7647e21dbe119a6eb7.zip |
Use implicit returns
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/aio.rs | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs index 909b59d7..d85ecfa1 100644 --- a/src/sys/aio.rs +++ b/src/sys/aio.rs @@ -111,9 +111,12 @@ impl<'a> AioCb<'a> { a.aio_nbytes = 0; a.aio_buf = null_mut(); - let aiocb = AioCb { aiocb: a, mutable: false, in_progress: false, - keeper: Keeper::none}; - aiocb + AioCb { + aiocb: a, + mutable: false, + in_progress: false, + keeper: Keeper::none + } } /// Constructs a new `AioCb`. @@ -136,9 +139,12 @@ impl<'a> AioCb<'a> { a.aio_buf = buf.as_ptr() as *mut c_void; a.aio_lio_opcode = opcode as libc::c_int; - let aiocb = AioCb { aiocb: a, mutable: true, in_progress: false, - keeper: Keeper::phantom(PhantomData)}; - aiocb + AioCb { + aiocb: a, + mutable: true, + in_progress: false, + keeper: Keeper::phantom(PhantomData) + } } /// Constructs a new `AioCb`. @@ -164,9 +170,12 @@ impl<'a> AioCb<'a> { a.aio_buf = buf.as_ptr() as *mut c_void; a.aio_lio_opcode = opcode as libc::c_int; - let aiocb = AioCb{ aiocb: a, mutable: true, in_progress: false, - keeper: Keeper::boxed(buf)}; - aiocb + AioCb { + aiocb: a, + mutable: true, + in_progress: false, + keeper: Keeper::boxed(buf) + } } /// Like `from_mut_slice`, but works on constant slices rather than @@ -195,9 +204,12 @@ impl<'a> AioCb<'a> { assert!(opcode != LioOpcode::LIO_READ, "Can't read into an immutable buffer"); a.aio_lio_opcode = opcode as libc::c_int; - let aiocb = AioCb { aiocb: a, mutable: false, in_progress: false, - keeper: Keeper::none}; - aiocb + AioCb { + aiocb: a, + mutable: false, + in_progress: false, + keeper: Keeper::none + } } fn common_init(fd: RawFd, prio: libc::c_int, |