diff options
author | Alan Somers <asomers@gmail.com> | 2022-11-21 11:15:55 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2022-11-21 11:15:55 -0700 |
commit | 59c21f772ac9b9c6c87da91aaf4e752331064990 (patch) | |
tree | 3c00fd9138993222966452c3c908fc7c85d7ecf4 /src | |
parent | 79f04fb3a34a4af6d8bdcc5807d63a980f483f94 (diff) | |
download | nix-59c21f772ac9b9c6c87da91aaf4e752331064990.zip |
Use the new UnixAddr::new_unnamed in the unit tests
Use it in the from_sockaddr_un_abstract_unnamed test. That test and
this method were introduced by PRs #1871 and #1857, which crossed each
other.
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/socket/addr.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 2b3e4919..8b23b10c 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -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())) |