Skip to content

Commit

Permalink
Rollup merge of #116289 - linkmauve:patch-1, r=the8472
Browse files Browse the repository at this point in the history
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
tmandry authored Oct 2, 2023
2 parents af77806 + 133aa56 commit 1edf723
Showing 1 changed file with 1 addition and 0 deletions.
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

0 comments on commit 1edf723

Please sign in to comment.