about summary refs log tree commit diff
path: root/src/libstd/process.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-07-15 03:06:58 -0700
committerGitHub <noreply@github.com>2016-07-15 03:06:58 -0700
commit3cc3ad11e6fadcba443cc50ba6ed03ab04d34355 (patch)
tree8f740d9a475036c51e4524543e9571e4f9664354 /src/libstd/process.rs
parentb6c1ef3745f707a0f76f17dc2b313b831ee1bfb0 (diff)
parent89593741540e125c768432bd98dbd4fdd1abd286 (diff)
downloadrust-3cc3ad11e6fadcba443cc50ba6ed03ab04d34355.tar.gz
rust-3cc3ad11e6fadcba443cc50ba6ed03ab04d34355.zip
Auto merge of #34819 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #34456, #34733, #34777, #34794, #34799, #34804, #34818
- Failed merges: #33951
Diffstat (limited to 'src/libstd/process.rs')
-rw-r--r--src/libstd/process.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 16bc81de78e..660c098d30b 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -605,6 +605,23 @@ pub struct ExitStatus(imp::ExitStatus);
 impl ExitStatus {
     /// Was termination successful? Signal termination not considered a success,
     /// and success is defined as a zero exit status.
+    ///
+    /// # Examples
+    ///
+    /// ```rust,no_run
+    /// use std::process::Command;
+    ///
+    /// let status = Command::new("mkdir")
+    ///                      .arg("projects")
+    ///                      .status()
+    ///                      .expect("failed to execute mkdir");
+    ///
+    /// if status.success() {
+    ///     println!("'projects/' directory created");
+    /// } else {
+    ///     println!("failed to create 'projects/' directory");
+    /// }
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn success(&self) -> bool {
         self.0.success()