Skip to content

Commit

Permalink
Use the new UnixAddr::new_unnamed in the unit tests
Browse files Browse the repository at this point in the history
Use it in the from_sockaddr_un_abstract_unnamed test.  That test and
this method were introduced by PRs nix-rust#1871 and nix-rust#1857, which crossed each
other.
  • Loading branch information
asomers committed Nov 21, 2022
1 parent 79f04fb commit 59c21f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sys/socket/addr.rs
Expand Up @@ -3197,8 +3197,7 @@ mod tests {
#[cfg(any(target_os = "android", target_os = "linux"))]
#[test]
fn from_sockaddr_un_abstract_unnamed() {
let empty = String::new();
let ua = UnixAddr::new_abstract(empty.as_bytes()).unwrap();
let ua = UnixAddr::new_unnamed();
let ptr = ua.as_ptr() as *const libc::sockaddr;
let ss = unsafe {
SockaddrStorage::from_raw(ptr, Some(ua.len()))
Expand Down

0 comments on commit 59c21f7

Please sign in to comment.