From 59c21f772ac9b9c6c87da91aaf4e752331064990 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 21 Nov 2022 11:15:55 -0700 Subject: 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. --- src/sys/socket/addr.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/sys/socket/addr.rs') 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())) -- cgit v1.2.3