-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
WIP: Document From
implementations in std::sys::unix::process
#96313
WIP: Document From
implementations in std::sys::unix::process
#96313
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. Please see the contribution instructions for more information. |
/// 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 { |
There was a problem hiding this comment.
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.
It looks like that link doesn't really work for me, but presuming you mean this implementation, I don't think that's something we need to add a doc comment to either. It's another internal implementation detail of std, since the ExitCode in question is an internal type. The actual From impl already has a short documentation comment, and there's more detail provided on the std::process::ExitCode type itself. I'm going to close this PR since I don't think we need to document these two particular From impls. In general, I'm not sure how much value documentation on From impls serves when they are just performing the obvious conversion between the two types, unless we have more detail to offer (e.g., the potential reallocation made in You can look at some other issues we've tagged as E-easy, which can be good starting points to contributing. |
Document
From
implementations for Stdio, ExitCodeIn connection with #51430