From 678a292dce4111ee909cb6017ced84a421f9a217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= Date: Sat, 7 Sep 2024 14:31:53 +0900 Subject: [PATCH] Update windows-sys 0.59 --- Cargo.toml | 2 +- src/sys/windows.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8ef85ebc..8c2f729a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,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 11f2b7b0..b6c95e24 100644 --- a/src/sys/windows.rs +++ b/src/sys/windows.rs @@ -890,7 +890,8 @@ 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. - storage.sun_path[..bytes.len()].copy_from_slice(bytes); + storage.sun_path[..bytes.len()] + .copy_from_slice(unsafe { mem::transmute::<&[u8], &[i8]>(bytes) }); let base = storage as *const _ as usize; let path = &storage.sun_path as *const _ as usize;