Skip to content

Commit

Permalink
Convert [u8] to [i8] in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Mar 12, 2024
1 parent 8e870c8 commit 6cb2f03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/fs/tests.rs
Expand Up @@ -1782,6 +1782,7 @@ fn windows_unix_socket_exists() {
}
let mut addr = c::SOCKADDR_UN { sun_family: c::AF_UNIX, sun_path: mem::zeroed() };
let bytes = socket_path.as_os_str().as_encoded_bytes();
let bytes = core::slice::from_raw_parts(bytes.as_ptr().cast::<i8>(), bytes.len());
addr.sun_path[..bytes.len()].copy_from_slice(bytes);
let len = mem::size_of_val(&addr) as i32;
let result = c::bind(socket, ptr::addr_of!(addr).cast::<c::SOCKADDR>(), len);
Expand Down

0 comments on commit 6cb2f03

Please sign in to comment.