Skip to content
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

process: Add as_std() method to Command #4295

Merged
merged 4 commits into from Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tokio/src/process/mod.rs
Expand Up @@ -264,6 +264,12 @@ impl Command {
Self::from(StdCommand::new(program))
}

/// Cheaply convert to a `&std::process::Command` for places where the type from the standard
/// library is expected.
pub fn as_std(&self) -> &StdCommand {
&self.std
}

/// Adds an argument to pass to the program.
///
/// Only one argument can be passed per use. So instead of:
Expand Down
6 changes: 5 additions & 1 deletion tokio/src/runtime/handle.rs
Expand Up @@ -26,7 +26,11 @@ pub struct Handle {

/// Handles to the signal drivers
#[cfg_attr(
not(any(feature = "signal", all(unix, feature = "process"))),
any(
loom,
not(all(unix, feature = "signal")),
not(all(unix, feature = "process")),
),
allow(dead_code)
)]
pub(super) signal_handle: driver::SignalHandle,
Expand Down