]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/os/windows/io/handle.rs
Document that `BorrowedFd` may be used to do a `dup`.
[rust.git] / library / std / src / os / windows / io / handle.rs
index 2f7c07c7910517db7fc264a46e632753234ce0ac..91b886c0888ee0e222d042420866470c5baac72e 100644 (file)
@@ -189,7 +189,7 @@ pub(crate) fn duplicate(
         access: c::DWORD,
         inherit: bool,
         options: c::DWORD,
-    ) -> io::Result<Self> {
+    ) -> io::Result<OwnedHandle> {
         let handle = self.as_raw_handle();
 
         // `Stdin`, `Stdout`, and `Stderr` can all hold null handles, such as
@@ -197,7 +197,7 @@ pub(crate) fn duplicate(
         // if we passed it a null handle, but we can treat null as a valid
         // handle which doesn't do any I/O, and allow it to be duplicated.
         if handle.is_null() {
-            return unsafe { Ok(Self::from_raw_handle(handle)) };
+            return unsafe { Ok(OwnedHandle::from_raw_handle(handle)) };
         }
 
         let mut ret = ptr::null_mut();
@@ -213,7 +213,7 @@ pub(crate) fn duplicate(
                 options,
             )
         })?;
-        unsafe { Ok(Self::from_raw_handle(ret)) }
+        unsafe { Ok(OwnedHandle::from_raw_handle(ret)) }
     }
 }