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 {
250
250
impl AsFd for net:: $t {
251
251
#[ inline]
252
252
fn as_fd( & self ) -> BorrowedFd <' _> {
253
- unsafe { BorrowedFd :: borrow_raw ( self . as_raw_fd ( ) ) }
253
+ self . as_inner ( ) . socket ( ) . as_fd ( )
254
254
}
255
255
}
256
256
257
257
impl From <net:: $t> for OwnedFd {
258
258
#[ inline]
259
259
fn from( socket: net:: $t) -> OwnedFd {
260
- unsafe { Self :: from_raw_fd ( socket. into_raw_fd ( ) ) }
260
+ socket. into_inner ( ) . into_socket ( ) . into_inner ( )
261
261
}
262
262
}
263
263
264
264
impl From <OwnedFd > for net:: $t {
265
265
#[ inline]
266
266
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 ) ) )
268
268
}
269
269
}
270
270
) * } ;
You can’t perform that action at this time.
0 commit comments