Skip to content

Commit b8f3ebc

Browse files
committed
fix clippy
1 parent d32a5f6 commit b8f3ebc

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

core/src/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn page_size() -> usize {
160160
cfg_if::cfg_if! {
161161
if #[cfg(windows)] {
162162
let mut info = std::mem::zeroed();
163-
windows_sys::Win32::System::SystemInformation::GetSystemInfo(&mut info);
163+
windows_sys::Win32::System::SystemInformation::GetSystemInfo(&raw mut info);
164164
ret = usize::try_from(info.dwPageSize).expect("get page size failed");
165165
} else {
166166
ret = usize::try_from(libc::sysconf(libc::_SC_PAGESIZE)).expect("get page size failed");

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ impl Operator<'_> {
235235
self,
236236
SUPPORT_TIMEOUT_ADD,
237237
Timeout,
238-
Timeout::new(&timeout).build().user_data(user_data as u64)
238+
Timeout::new(&raw const timeout)
239+
.build()
240+
.user_data(user_data as u64)
239241
)
240242
}
241243
Ok(())
@@ -254,7 +256,7 @@ impl Operator<'_> {
254256
self,
255257
SUPPORT_TIMEOUT_UPDATE,
256258
TimeoutUpdate,
257-
TimeoutUpdate::new(user_data as u64, &timeout)
259+
TimeoutUpdate::new(user_data as u64, &raw const timeout)
258260
.build()
259261
.user_data(user_data as u64)
260262
)

core/src/syscall/windows/connect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
7171
SOL_SOCKET,
7272
SO_ERROR,
7373
std::ptr::addr_of_mut!(err).cast::<u8>(),
74-
&mut len,
74+
&raw mut len,
7575
);
7676
}
7777
if r != 0 {
@@ -86,7 +86,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
8686
unsafe {
8787
let mut address = std::mem::zeroed();
8888
let mut address_len = c_int::try_from(size_of_val(&address)).expect("overflow");
89-
r = getpeername(fd, &mut address, &mut address_len);
89+
r = getpeername(fd, &raw mut address, &raw mut address_len);
9090
}
9191
} else if errno != Some(WSAEINTR) {
9292
break;

core/src/syscall/windows/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ extern "system" fn set_non_blocking_flag(fd: SOCKET, on: bool) -> bool {
886886
windows_sys::Win32::Networking::WinSock::ioctlsocket(
887887
fd,
888888
windows_sys::Win32::Networking::WinSock::FIONBIO,
889-
&mut argp,
889+
&raw mut argp,
890890
) == 0
891891
}
892892
}
@@ -913,7 +913,7 @@ pub extern "system" fn send_time_limit(fd: SOCKET) -> u64 {
913913
SOL_SOCKET,
914914
SO_SNDTIMEO,
915915
std::ptr::from_mut(&mut ms).cast(),
916-
&mut len,
916+
&raw mut len,
917917
)
918918
} == -1
919919
{
@@ -950,7 +950,7 @@ pub extern "system" fn recv_time_limit(fd: SOCKET) -> u64 {
950950
SOL_SOCKET,
951951
SO_RCVTIMEO,
952952
std::ptr::from_mut(&mut ms).cast(),
953-
&mut len,
953+
&raw mut len,
954954
)
955955
} == -1
956956
{

core/src/syscall/windows/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<I: SelectSyscall> SelectSyscall for NioSelectSyscall<I> {
8484
loop {
8585
r = self
8686
.inner
87-
.select(fn_ptr, nfds, readfds, writefds, errorfds, &mut o);
87+
.select(fn_ptr, nfds, readfds, writefds, errorfds, &raw mut o);
8888
if r != 0 || t == 0 {
8989
break;
9090
}

0 commit comments

Comments
 (0)