8000 Rollup of 11 pull requests by eddyb · Pull Request #40147 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 11 pull requests #40147

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
wants to merge 31 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7e0c3de
Remove `else`, unindent.
frewsxcv Feb 19, 2017
de2f7e1
Rewrite `match` to use combinators.
frewsxcv Feb 19, 2017
83fe48d
Remove `else`, unindent.
frewsxcv Feb 19, 2017
a97aed7
Remove unnecessary logic when finding simpilar `impl` candidates.
frewsxcv Feb 19, 2017
2436d73
Extract out error message generation.
frewsxcv Feb 19, 2017
10639d7
Add early return, remove `else`, unindent.
frewsxcv Feb 19, 2017
23d9211
Flatten `for` loop using iterator combinators.
frewsxcv Feb 19, 2017
a754ea6
Move `TraitRef` `impl` next to `struct` definition.
frewsxcv Feb 20, 2017
d3b8f56
Add missing urls and examples for Condvar docs
GuillaumeGomez Feb 22, 2017
8c8eda8
Fix nightly-only experimental API display
GuillaumeGomez Feb 23, 2017
98fd50a
teach rustc about remove_stable_features and removed no-stack-chech f…
benschreiber Feb 26, 2017
9c5e4af
removed unneeded comment blocks
benschreiber Feb 26, 2017
8079bf3
Example for how to provide stdin using std::process::Command
robinst Feb 27, 2017
e998666
Remove unnecessary "for"
koba-e964 Feb 27, 2017
c0dfea6
Add Cargo as a submodule
alexcrichton Feb 15, 2017
b70f929
Make lifetime elision docs clearer
MajorBreakfast Feb 27, 2017
988be44
Add compile fail test for unboxed_closures feature
topecongiro Feb 23, 2017
6f24c6a
rustbuild: Add support for compiling Cargo
alexcrichton Feb 15, 2017
5933560
Add missing docs and examples for fmt::Write
GuillaumeGomez Feb 27, 2017
fb2d763
Replace ./configure with config.toml in README.md and CONTRIBUTING.md
keeperofdakeys Feb 23, 2017
ad4575c
Rollup merge of #39917 - alexcrichton:build-cargo, r=brson
eddyb Feb 28, 2017
8796283
Rollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb
eddyb Feb 28, 2017
e72bc00
Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv
eddyb Feb 28, 2017
718882e
Rollup merge of #40047 - topecongiro:master, r=est31
eddyb Feb 28, 2017
03a3daa
Rollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton
eddyb Feb 28, 2017
c900120
Rollup merge of #40057 - GuillaumeGomez:html-issue, r=frewsxcv
eddyb Feb 28, 2017
4fdeeb7
Rollup merge of #40110 - benschreiber:nostackcheck, r=brson
eddyb Feb 28, 2017
8279c81
Rollup merge of #40122 - robinst:process-add-example-for-writing-to-s…
eddyb Feb 28, 2017
27a88d1
Rollup merge of #40124 - koba-e964:patch-1, r=steveklabnik
eddyb Feb 28, 2017
e640c79
Rollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv
eddyb Feb 28, 2017
3fbe6b8
Rollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik
eddyb Feb 28, 2017
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
Prev Previous commit
Next Next commit
Example for how to provide stdin using std::process::Command
Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.
  • Loading branch information
robinst committed Feb 27, 2017
commit 8079bf35c596eef32ec872d35e28c90e4744f61e
25 changes: 25 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@
//!
//! assert!(ecode.success());
//! ```
//!
//! Calling a command with input and reading its output:
//!
//! ```no_run
//! use std::process::{Command, Stdio};
//! use std::io::Write;
//!
//! let mut child = Command::new("/bin/cat")
//! .stdin(Stdio::piped())
//! .stdout(Stdio::piped())
//! .spawn()
//! .expect("failed to execute child");
//!
//! {
//! // limited borrow of stdin
//! let stdin = child.stdin.as_mut().expect("failed to get stdin");
//! stdin.write_all(b"test").expect("failed to write to stdin");
//! }
//!
//! let output = child
//! .wait_with_output()
//! .expect("failed to wait on child");
//!
//! assert_eq!(b"test", output.stdout.as_slice());
//! ```

#![stable(feature = "process", since = "1.0.0")]

Expand Down
0