Skip to content

Commit 54e7215

Browse files
committed
Support MSRV 1.63
pointer::cast_mut was stablised in 1.65, so it's too new.
1 parent fc41670 commit 54e7215

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control> {
606606
/// Corresponds to setting `msg_iov` and `msg_iovlen` on Unix and `lpBuffers`
607607
/// and `dwBufferCount` on Windows.
608608
pub fn with_buffers(mut self, bufs: &'bufs [IoSlice<'_>]) -> Self {
609-
let ptr = bufs.as_ptr().cast_mut().cast();
609+
let ptr = bufs.as_ptr() as *mut _;
610610
sys::set_msghdr_iov(&mut self.inner, ptr, bufs.len());
611611
self
612612
}
@@ -616,7 +616,7 @@ impl<'addr, 'bufs, 'control> MsgHdr<'addr, 'bufs, 'control> {
616616
/// Corresponds to setting `msg_control` and `msg_controllen` on Unix and
617617
/// `Control` on Windows.
618618
pub fn with_control(mut self, buf: &'control [u8]) -> Self {
619-
let ptr = buf.as_ptr().cast_mut().cast();
619+
let ptr = buf.as_ptr() as *mut _;
620620
sys::set_msghdr_control(&mut self.inner, ptr, buf.len());
621621
self
622622
}

src/sys/unix.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -648,11 +648,12 @@ pub(crate) use libc::msghdr;
648648

649649
#[cfg(not(target_os = "redox"))]
650650
pub(crate) fn set_msghdr_name(msg: &mut msghdr, name: &SockAddr) {
651-
msg.msg_name = name.as_ptr().cast_mut().cast();
651+
msg.msg_name = name.as_ptr() as *mut _;
652652
msg.msg_namelen = name.len();
653653
}
654654

655655
#[cfg(not(target_os = "redox"))]
656+
#[allow(clippy::unnecessary_cast)] // IovLen type can be `usize`.
656657
pub(crate) fn set_msghdr_iov(msg: &mut msghdr, ptr: *mut libc::iovec, len: usize) {
657658
msg.msg_iov = ptr;
658659
msg.msg_iovlen = min(len, IovLen::MAX as usize) as IovLen;

src/sys/windows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'a> MaybeUninitSlice<'a> {
191191
pub(crate) use windows_sys::Win32::Networking::WinSock::WSAMSG as msghdr;
192192

193193
pub(crate) fn set_msghdr_name(msg: &mut msghdr, name: &SockAddr) {
194-
msg.name = name.as_ptr().cast_mut().cast();
194+
msg.name = name.as_ptr() as *mut _;
195195
msg.namelen = name.len();
196196
}
197197

0 commit comments

Comments
 (0)