Skip to content

Commit f90986e

Browse files
Add examples for exit function
1 parent 2cdbd5e commit f90986e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/process.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,14 @@ impl Child {
827827
/// will be run. If a clean shutdown is needed it is recommended to only call
828828
/// this function at a known point where there are no more destructors left
829829
/// to run.
830+
///
831+
/// # Examples
832+
///
833+
/// ```
834+
/// use std::process;
835+
///
836+
/// process::exit(0);
837+
/// ```
830838
#[stable(feature = "rust1", since = "1.0.0")]
831839
pub fn exit(code: i32) -> ! {
832840
::sys_common::cleanup();

0 commit comments

Comments
 (0)