Skip to content

Commit 8dd22cb

Browse files
committed
address more
Signed-off-by: Xuanwo <[email protected]>
1 parent 589d7b3 commit 8dd22cb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

monoio/src/driver/op/accept.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ impl OpAble for Accept {
122122
let stream_fd = syscall_u32!(accept(fd, addr, len))? as i32;
123123
syscall_u32!(fcntl(stream_fd, libc::F_SETFD, libc::FD_CLOEXEC))
124124
.and_then(|_| syscall_u32!(fcntl(stream_fd, libc::F_SETFL, libc::O_NONBLOCK)))
125-
.map_err(|e| {
125+
.inspect_err(|_| {
126126
let _ = syscall_u32!(close(stream_fd));
127-
e
128127
})?;
129128
Ok(stream_fd as _)
130129
};

monoio/src/net/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,12 @@ pub(crate) fn new_socket(
115115
NO_ERROR as _
116116
)
117117
.map(|_: i32| socket as RawSocket)
118-
.map_err(|e| {
118+
.inspect_err(|_| {
119119
// If either of the `ioctlsocket` calls failed, ensure the socket is
120120
// closed and return the error.
121121
unsafe {
122122
closesocket(socket);
123123
WSACleanup();
124124
}
125-
e
126125
})
127126
}

0 commit comments

Comments
 (0)