Skip to content

Commit

Permalink
process: add as_std() method to Command (#4295)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipetkov committed Dec 3, 2021
1 parent 64da914 commit ee4b2ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tokio/src/process/mod.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit ee4b2ed

Please sign in to comment.