Skip to content
Prev Previous commit
Next Next commit
Add missing #[inline] on AsFd impl for sys::unix::fs::File
This operation should be extremely cheap, at most the mov of the underlying
file descriptor, but due to this missing #[inline] it is currently a function
call.
  • Loading branch information
linkmauve authored Sep 30, 2023
commit 133aa56a84a4d52a066c4fbf12b53314310e91e1
1 change: 1 addition & 0 deletions library/std/src/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,7 @@ impl FromInner<FileDesc> for File {
}

impl AsFd for File {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
self.0.as_fd()
}
Expand Down