Skip to content

Commit 771d6d8

Browse files
committed
Add saferty doc to Fd::new_owned
Signed-off-by: Jiahao XU <[email protected]>
1 parent 6fd7cc0 commit 771d6d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/native_mux_impl/stdio.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ impl Fd {
6868
}
6969
}
7070

71+
/// # Safety
72+
///
73+
/// `T::into_raw_fd` must return a valid fd and transfers
74+
/// the ownershipt of it.
7175
unsafe fn new_owned<T: IntoRawFd>(fd: T) -> Self {
7276
let raw_fd = fd.into_raw_fd();
7377
Fd::Owned(OwnedFd::from_raw_fd(raw_fd))

0 commit comments

Comments
 (0)