]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/os/fd/owned.rs
Rollup merge of #93663 - sunfishcode:sunfishcode/as-raw-name, r=joshtriplett
[rust.git] / library / std / src / os / fd / owned.rs
index 10e9ec61a78452d81f61d99687b2f822d16b6032..807b057234ac1e3be37f786349bf2a6c8c5f7033 100644 (file)
@@ -66,7 +66,7 @@ impl BorrowedFd<'_> {
     /// the returned `BorrowedFd`, and it must not have the value `-1`.
     #[inline]
     #[unstable(feature = "io_safety", issue = "87074")]
-    pub unsafe fn borrow_raw_fd(fd: RawFd) -> Self {
+    pub unsafe fn borrow_raw(fd: RawFd) -> Self {
         assert_ne!(fd, u32::MAX as RawFd);
         // SAFETY: we just asserted that the value is in the valid range and isn't `-1` (the only value bigger than `0xFF_FF_FF_FE` unsigned)
         unsafe { Self { fd, _phantom: PhantomData } }
@@ -235,7 +235,7 @@ fn as_fd(&self) -> BorrowedFd<'_> {
         // Safety: `OwnedFd` and `BorrowedFd` have the same validity
         // invariants, and the `BorrowdFd` is bounded by the lifetime
         // of `&self`.
-        unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
+        unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
     }
 }