Skip to content

Commit dd97053

Browse files
committed
Update to Windows-sys v0.59
1 parent 795e974 commit dd97053

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ features = ["all"]
5454
libc = "0.2.172"
5555

5656
[target.'cfg(windows)'.dependencies.windows-sys]
57-
version = "0.52"
57+
version = "0.59"
5858
features = [
5959
"Win32_Foundation",
6060
"Win32_Networking_WinSock",

src/sys/windows.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,9 +938,11 @@ pub(crate) fn unix_sockaddr(path: &Path) -> io::Result<SockAddr> {
938938
}
939939

940940
storage.sun_family = crate::sys::AF_UNIX as sa_family_t;
941+
// SAFETY: casting `[u8]` to `[i8]` is safe.
942+
let b = unsafe { &*(bytes as *const [u8] as *const [i8]) };
941943
// `storage` was initialized to zero above, so the path is
942944
// already null terminated.
943-
storage.sun_path[..bytes.len()].copy_from_slice(bytes);
945+
storage.sun_path[..bytes.len()].copy_from_slice(b);
944946

945947
let base = storage as *const _ as usize;
946948
let path = &storage.sun_path as *const _ as usize;

0 commit comments

Comments
 (0)