diff options
author | Alan Somers <asomers@gmail.com> | 2020-05-16 18:05:01 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2020-06-27 17:36:46 -0600 |
commit | af45859aa00670b8cea6a9704d8fd3b35db2ac93 (patch) | |
tree | 1f8469d141644091f50d2ed5e2f2df8f01e5eb9a /src/sys/socket/mod.rs | |
parent | 309477210c8be94f7015904fd556f70bf26c0198 (diff) | |
download | nix-af45859aa00670b8cea6a9704d8fd3b35db2ac93.zip |
Make SockAddr::as_ffi_pair safe
It was only marked unsafe because it did a pointer cast, but that
particular pointer cast is always allowed by C.
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index d9b94f07..aafa849c 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -1251,7 +1251,7 @@ fn pack_mhdr_to_send<'a, I, C>( // Next encode the sending address, if provided let (name, namelen) = match addr { Some(addr) => { - let (x, y) = unsafe { addr.as_ffi_pair() }; + let (x, y) = addr.as_ffi_pair(); (x as *const _, y) }, None => (ptr::null(), 0), |