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

Skip to content

Rollup of 9 pull requests #40148

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

Merged
merged 25 commits into from
Feb 28, 2017
Merged
Changes from 1 commit
Commits
Show all changes
25 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
8079bf3
Example for how to provide stdin using std::process::Command
robinst Feb 27, 2017
e998666
Remove unnecessary "for"
koba-e964 Feb 27, 2017
b70f929
Make lifetime elision docs clearer
MajorBreakfast Feb 27, 2017
988be44
Add compile fail test for unboxed_closures feature
topecongiro Feb 23, 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
227285f
Rollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb
frewsxcv Feb 28, 2017
5be0d9f
Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv
frewsxcv Feb 28, 2017
922a262
Rollup merge of #40047 - topecongiro:master, r=est31
frewsxcv Feb 28, 2017
2623d35
Rollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton
frewsxcv Feb 28, 2017
15cd43b
Rollup merge of #40057 - GuillaumeGomez:html-issue, r 8000 =frewsxcv
frewsxcv Feb 28, 2017
6ac7bf5
Rollup merge of #40122 - robinst:process-add-example-for-writing-to-s…
frewsxcv Feb 28, 2017
da703a8
Rollup merge of #40124 - koba-e964:patch-1, r=steveklabnik
frewsxcv Feb 28, 2017
c4b6c98
Rollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv
frewsxcv Feb 28, 2017
a851fc1
Rollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik
frewsxcv 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