Skip to content

Commit

Permalink
process: updated example (#3748)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGlolenstine authored May 5, 2021
1 parent 55c5d12 commit 541b0c3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tokio/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,22 @@ impl Child {
/// If the caller wishes to explicitly control when the child's stdin
/// handle is closed, they may `.take()` it before calling `.wait()`:
///
/// ```no_run
/// ```
/// # #[cfg(not(unix))]fn main(){}
/// # #[cfg(unix)]
/// use tokio::io::AsyncWriteExt;
/// # #[cfg(unix)]
/// use tokio::process::Command;
/// # #[cfg(unix)]
/// use std::process::Stdio;
///
/// # #[cfg(unix)]
/// #[tokio::main]
/// async fn main() {
/// let mut child = Command::new("cat").spawn().unwrap();
/// let mut child = Command::new("cat")
/// .stdin(Stdio::piped())
/// .spawn()
/// .unwrap();
///
/// let mut stdin = child.stdin.take().unwrap();
/// tokio::spawn(async move {
Expand Down

0 comments on commit 541b0c3

Please sign in to comment.