Skip to content

WIP: Document From implementations in std::sys::unix::process #96313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions library/std/src/sys/unix/process/process_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,20 @@ impl Stdio {
}

impl From<AnonPipe> for Stdio {
/// Converts a [`AnonPipe`] into a [`Stdio`].
///
/// The conversion consumes the [`AnonPipe`].
///
fn from(pipe: AnonPipe) -> Stdio {
Stdio::Fd(pipe.into_inner())
}
}

impl From<File> for Stdio {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two implementations are not exposed outside of std, as Stdio here is an internal type (defined in this very module, and not public). This can be a little confusing since there's also a public std::process::Stdio, but that's an unrelated type.

I don't think it's useful to add documentation to these, particularly since these impls are pretty trivial -- we're not doing anything interesting in them.

/// Converts a [`File`] into a [`Stdio`].
///
/// The conversion consumes the [`File`].
///
fn from(file: File) -> Stdio {
Stdio::Fd(file.into_inner())
}
Expand Down