Skip to content

Commit

Permalink
Merge #1880
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors[bot] and asomers committed Nov 21, 2022
2 parents 79f04fb + 59c21f7 commit 8522191
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 8522191

Please sign in to comment.