Skip to content

Commit 755fc6d

Browse files
committed
code polish
1 parent d53ed92 commit 755fc6d

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

core/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
clippy::indexing_slicing,
5151
clippy::separated_literal_suffix, // conflicts with clippy::unseparated_literal_suffix
5252
clippy::single_char_lifetime_names, // TODO: change lifetime names
53+
unknown_lints, // for windows nightly
54+
linker_messages, // for windows nightly
55+
unused_attributes, // for windows nightly
5356
)]
5457
#![doc = include_str!("../docs/en/overview.md")]
5558

core/src/net/operator/windows/mod.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<'o> Operator<'o> {
157157
}
158158
entries.set_len(recv_count as _);
159159
for entry in entries {
160-
let mut cqe = *Box::from_raw(entry.lpOverlapped.cast::<Overlapped>());
160+
let mut cqe = Box::from_raw(entry.lpOverlapped.cast::<Overlapped>());
161161
// resolve completed read/write tasks
162162
cqe.result = match cqe.syscall_name {
163163
SyscallName::accept => {
@@ -177,18 +177,11 @@ impl<'o> Operator<'o> {
177177
SyscallName::recv
178178
| SyscallName::WSARecv
179179
| SyscallName::send
180-
| SyscallName::WSASend => {
181-
let r = entry.dwNumberOfBytesTransferred.into();
182-
if r > 0 {
183-
r
184-
} else {
185-
-c_longlong::from(WSAEINPROGRESS)
186-
}
187-
}
180+
| SyscallName::WSASend => entry.dwNumberOfBytesTransferred.into(),
188181
_ => panic!("unsupported"),
189182
};
190183
eprintln!("IOCP got:{cqe}");
191-
cq.push(cqe);
184+
cq.push(*cqe);
192185
}
193186
}
194187
if cq.len() >= want {

hook/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
clippy::separated_literal_suffix, // conflicts with clippy::unseparated_literal_suffix
4646
clippy::single_char_lifetime_names, // TODO: change lifetime names
4747
clippy::test_attr_in_doctest,
48-
unknown_lints,
49-
linker_messages,
48+
unknown_lints, // for windows nightly
49+
linker_messages, // for windows nightly
5050
)]
5151
#![doc = include_str!("../docs/en/hook.md")]
5252

open-coroutine/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
clippy::indexing_slicing,
4545
clippy::separated_literal_suffix, // conflicts with clippy::unseparated_literal_suffix
4646
clippy::single_char_lifetime_names, // TODO: change lifetime names
47+
unknown_lints, // for windows nightly
48+
linker_messages, // for windows nightly
49+
unused_attributes, // for windows nightly
4750
)]
4851
//! see `https://github.com/acl-dev/open-coroutine`
4952

0 commit comments

Comments
 (0)