summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-11-14 16:19:54 +0900
committerHomu <homu@barosl.com>2016-11-14 16:19:54 +0900
commita9f630ed00ec9d98dfdd0d84127c8f44ca92bcb9 (patch)
treeab48c9bbb619775cb7e94301a170b80b551976c1 /src/unistd.rs
parent853a7db630af188509dd2be1c542eb8d498818b8 (diff)
parentea140702a5e82b337b790b8e7a37bdbe31ed73e9 (diff)
downloadnix-a9f630ed00ec9d98dfdd0d84127c8f44ca92bcb9.zip
Auto merge of #465 - asomers:cleanup, r=posborne
Avoid TempDir::into_path(), because it doesn't cleanup on Drop
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index e97bcdb9..68a22ea1 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -262,12 +262,12 @@ pub fn chdir<P: ?Sized + NixPath>(path: &P) -> Result<()> {
/// use tempdir::TempDir;
///
/// fn main() {
-/// let mut tmp_dir = TempDir::new("test_mkdir").unwrap().into_path();
-/// tmp_dir.push("new_dir");
+/// let tmp_dir1 = TempDir::new("test_mkdir").unwrap();
+/// let tmp_dir2 = tmp_dir1.path().join("new_dir");
///
/// // 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),
+/// match unistd::mkdir(&tmp_dir2, stat::S_IRWXU) {
+/// Ok(_) => println!("created {:?}", tmp_dir2),
/// Err(err) => println!("Error creating directory: {}", err),
/// }
/// }