From a0b73f4addb4aacd34da20c0f3a6a1268a626c32 Mon Sep 17 00:00:00 2001 From: Tomas Agustin Raies Date: Tue, 25 Feb 2025 11:26:41 -0800 Subject: [PATCH 1/2] Bump `windows-sys` to 0.59 --- Cargo.toml | 2 +- src/sys/windows.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 18331f61..3d143726 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ features = ["all"] libc = "0.2.150" [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.52" +version = "0.59" features = [ "Win32_Foundation", "Win32_Networking_WinSock", diff --git a/src/sys/windows.rs b/src/sys/windows.rs index 10852f19..e1b46726 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -931,6 +931,7 @@ pub(crate) fn unix_sockaddr(path: &Path) -> io::Result { storage.sun_family = crate::sys::AF_UNIX as sa_family_t; // `storage` was initialized to zero above, so the path is // already null terminated. + let bytes: &[i8] = unsafe { slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; storage.sun_path[..bytes.len()].copy_from_slice(bytes); let base = storage as *const _ as usize; From c5646ef9d86d9bb11f72fef85da13ff5bf112962 Mon Sep 17 00:00:00 2001 From: Tomas Agustin Raies Date: Tue, 25 Feb 2025 11:39:42 -0800 Subject: [PATCH 2/2] Ran rustfmt on windows.rs --- src/sys/windows.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/windows.rs b/src/sys/windows.rs index e1b46726..f86ced0f 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -931,7 +931,7 @@ pub(crate) fn unix_sockaddr(path: &Path) -> io::Result { storage.sun_family = crate::sys::AF_UNIX as sa_family_t; // `storage` was initialized to zero above, so the path is // already null terminated. - let bytes: &[i8] = unsafe { slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; + let bytes: &[i8] = unsafe { slice::from_raw_parts(bytes.as_ptr().cast(), bytes.len()) }; storage.sun_path[..bytes.len()].copy_from_slice(bytes); let base = storage as *const _ as usize;