Skip to content

Commit 3b314b4

Browse files
author
Bryant Mairs
committed
Use implicit returns
1 parent 807788f commit 3b314b4

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

src/sys/aio.rs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ impl<'a> AioCb<'a> {
111111
a.aio_nbytes = 0;
112112
a.aio_buf = null_mut();
113113

114-
let aiocb = AioCb { aiocb: a, mutable: false, in_progress: false,
115-
keeper: Keeper::none};
116-
aiocb
114+
AioCb {
115+
aiocb: a,
116+
mutable: false,
117+
in_progress: false,
118+
keeper: Keeper::none
119+
}
117120
}
118121

119122
/// Constructs a new `AioCb`.
@@ -136,9 +139,12 @@ impl<'a> AioCb<'a> {
136139
a.aio_buf = buf.as_ptr() as *mut c_void;
137140
a.aio_lio_opcode = opcode as libc::c_int;
138141

139-
let aiocb = AioCb { aiocb: a, mutable: true, in_progress: false,
140-
keeper: Keeper::phantom(PhantomData)};
141-
aiocb
142+
AioCb {
143+
aiocb: a,
144+
mutable: true,
145+
in_progress: false,
146+
keeper: Keeper::phantom(PhantomData)
147+
}
142148
}
143149

144150
/// Constructs a new `AioCb`.
@@ -164,9 +170,12 @@ impl<'a> AioCb<'a> {
164170
a.aio_buf = buf.as_ptr() as *mut c_void;
165171
a.aio_lio_opcode = opcode as libc::c_int;
166172

167-
let aiocb = AioCb{ aiocb: a, mutable: true, in_progress: false,
168-
keeper: Keeper::boxed(buf)};
169-
aiocb
173+
AioCb {
174+
aiocb: a,
175+
mutable: true,
176+
in_progress: false,
177+
keeper: Keeper::boxed(buf)
178+
}
170179
}
171180

172181
/// Like `from_mut_slice`, but works on constant slices rather than
@@ -195,9 +204,12 @@ impl<'a> AioCb<'a> {
195204
assert!(opcode != LioOpcode::LIO_READ, "Can't read into an immutable buffer");
196205
a.aio_lio_opcode = opcode as libc::c_int;
197206

198-
let aiocb = AioCb { aiocb: a, mutable: false, in_progress: false,
199-
keeper: Keeper::none};
200-
aiocb
207+
AioCb {
208+
aiocb: a,
209+
mutable: false,
210+
in_progress: false,
211+
keeper: Keeper::none
212+
}
201213
}
202214

203215
fn common_init(fd: RawFd, prio: libc::c_int,

0 commit comments

Comments
 (0)