Skip to content

Commit

Permalink
Add missing #[inline] on AsFd impl for sys::unix::fs::File
Browse files Browse the repository at this point in the history
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
1 parent 75d731e commit 133aa56
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 133aa56

Please sign in to comment.