From 133aa56a84a4d52a066c4fbf12b53314310e91e1 Mon Sep 17 00:00:00 2001 From: linkmauve Date: Sat, 30 Sep 2023 17:56:42 +0200 Subject: [PATCH] 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. --- library/std/src/sys/unix/fs.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 764e1f25790..5ed2bdd7fe3 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -1391,6 +1391,7 @@ impl FromInner for File { } impl AsFd for File { + #[inline] fn as_fd(&self) -> BorrowedFd<'_> { self.0.as_fd() }