File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,23 @@ pub struct ExitStatus(imp::ExitStatus);
605605impl ExitStatus {
606606 /// Was termination successful? Signal termination not considered a success,
607607 /// and success is defined as a zero exit status.
608+ ///
609+ /// # Examples
610+ ///
611+ /// ```rust,no_run
612+ /// use std::process::Command;
613+ ///
614+ /// let status = Command::new("mkdir")
615+ /// .arg("projects")
616+ /// .status()
617+ /// .expect("failed to execute mkdir");
618+ ///
619+ /// if status.success() {
620+ /// println!("'projects/' directory created");
621+ /// } else {
622+ /// println!("failed to create 'projects/' directory");
623+ /// }
624+ /// ```
608625 #[ stable( feature = "process" , since = "1.0.0" ) ]
609626 pub fn success ( & self ) -> bool {
610627 self . 0 . success ( )
You can’t perform that action at this time.
0 commit comments