File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -250,21 +250,21 @@ macro_rules! impl_owned_fd_traits {
250250 impl AsFd for net:: $t {
251251 #[ inline]
252252 fn as_fd( & self ) -> BorrowedFd <' _> {
253- unsafe { BorrowedFd :: borrow_raw ( self . as_raw_fd ( ) ) }
253+ self . as_inner ( ) . socket ( ) . as_fd ( )
254254 }
255255 }
256256
257257 impl From <net:: $t> for OwnedFd {
258258 #[ inline]
259259 fn from( socket: net:: $t) -> OwnedFd {
260- unsafe { Self :: from_raw_fd ( socket. into_raw_fd ( ) ) }
260+ socket. into_inner ( ) . into_socket ( ) . into_inner ( )
261261 }
262262 }
263263
264264 impl From <OwnedFd > for net:: $t {
265265 #[ inline]
266266 fn from( owned_fd: OwnedFd ) -> Self {
267- unsafe { Self :: from_raw_fd ( owned_fd . into_raw_fd ( ) ) }
267+ Self :: from_inner ( FromInner :: from_inner ( FromInner :: from_inner ( owned_fd ) ) )
268268 }
269269 }
270270 ) * } ;
You can’t perform that action at this time.
0 commit comments