Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upprocess::ExitStatus should have some kind of constructor #32713
Comments
nrc
added
A-libs
labels
Apr 3, 2016
This comment has been minimized.
This comment has been minimized.
|
Should the constructor just take an |
This comment has been minimized.
This comment has been minimized.
|
I've also wanted a basically "raw constructor" in the past. I'd be fine adding some |
This comment has been minimized.
This comment has been minimized.
jirutka
commented
Apr 26, 2016
|
+1 |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 26, 2016
alexcrichton
referenced this issue
Apr 26, 2016
Merged
std: Allow creating ExitStatus from raw values #33224
This comment has been minimized.
This comment has been minimized.
|
I've opened a PR for this over at #33224 |
This comment has been minimized.
This comment has been minimized.
jirutka
commented
Apr 26, 2016
|
Great, thanks! |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 27, 2016
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
May 9, 2016
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
May 9, 2016
bors
added a commit
that referenced
this issue
May 9, 2016
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
May 9, 2016
alexcrichton
added
T-libs
B-unstable
labels
Jun 21, 2016
This comment has been minimized.
This comment has been minimized.
joelself
commented
Jul 6, 2016
|
This would help n00bs like me who start out by copying the example code and tweaking it: let output = Command::new("sh")
.arg("-c")
.arg("echo hello")
.output()
.unwrap_or_else(|e| { panic!("failed to execute process: {}", e) });This example is a special case that only happens to work if the |
alexcrichton
added
I-nominated
final-comment-period
and removed
I-nominated
labels
Jul 11, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Discussed recently, the libs team decided to stabilize. |
nrc commentedApr 3, 2016
Because
ExitStatushas a private field it is impossible to create one in user code, one must actually execute a process. This prevents testing/mocking. My use case is that I have some function which runs a process and generates data, however, for testing I want to mock the test run and just return a success exit status and some data. I can't do that because I can't create my ownExitStatusobjects.At the least there should be a way to create a success
ExitStatus. Preferably, there would be a way to create various fail statuses too.