We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55e1104 commit fdde09cCopy full SHA for fdde09c
src/libstd/sys/unix/ext/net.rs
@@ -51,13 +51,11 @@ use libc::MSG_NOSIGNAL;
51
const MSG_NOSIGNAL: libc::c_int = 0x0;
52
53
fn sun_path_offset() -> usize {
54
- unsafe {
55
- // Work with an actual instance of the type since using a null pointer is UB
56
- let addr: libc::sockaddr_un = mem::uninitialized();
57
- let base = &addr as *const _ as usize;
58
- let path = &addr.sun_path as *const _ as usize;
59
- path - base
60
- }
+ // Work with an actual instance of the type since using a null pointer is UB
+ let addr: libc::sockaddr_un = unsafe { mem::uninitialized() };
+ let base = &addr as *const _ as usize;
+ let path = &addr.sun_path as *const _ as usize;
+ path - base
61
}
62
63
unsafe fn sockaddr_un(path: &Path) -> io::Result<(libc::sockaddr_un, libc::socklen_t)> {
0 commit comments