summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Keller <philipp.keller@gmail.com>2016-09-06 22:28:13 +0200
committerPhilipp Keller <philipp.keller@gmail.com>2016-09-06 22:28:13 +0200
commit37e4f9756d7181e6b95f9b812874d582bfc2eec5 (patch)
treecd46761e981f549b1f8255d289cba0fb95a69a02
parent50693c11b02f11e13687ee48f5a1e0131542d7f8 (diff)
downloadnix-37e4f9756d7181e6b95f9b812874d582bfc2eec5.zip
rust 1.2.0 doesn't support expect, switched to proper match block
-rw-r--r--src/unistd.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index 52add2cd..d7bd3b91 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -139,8 +139,11 @@ pub fn chdir<P: ?Sized + NixPath>(path: &P) -> Result<()> {
/// let mut tmp_dir = TempDir::new("test_mkdir").unwrap().into_path();
/// tmp_dir.push("new_dir");
///
-/// // owner has read, write and execute rights on the new directory
-/// unistd::mkdir(&tmp_dir, stat::S_IRWXU).expect("couldn't create directory");
+/// // create new directory and give read, write and execute rights to the owner
+/// match unistd::mkdir(&tmp_dir, stat::S_IRWXU) {
+/// Ok(_) => println!("created {:?}", tmp_dir.display()),
+/// Err(err) => println!("Error creating directory: {}", err),
+/// }
/// }
/// ```
#[inline]