diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-11-21 18:22:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 18:22:08 +0000 |
commit | 852219119ec5f3533ea22a7e07f41f61b158bf90 (patch) | |
tree | 3c00fd9138993222966452c3c908fc7c85d7ecf4 /src | |
parent | 79f04fb3a34a4af6d8bdcc5807d63a980f483f94 (diff) | |
parent | 59c21f772ac9b9c6c87da91aaf4e752331064990 (diff) | |
download | nix-852219119ec5f3533ea22a7e07f41f61b158bf90.zip |
Merge #1880
1880: Use the new UnixAddr::new_unnamed in the unit tests r=rtzoeller a=asomers
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.
Co-authored-by: Alan Somers <asomers@gmail.com>
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())) |