This repository was archived by the owner on Aug 20, 2021. It is now read-only.
File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ appveyor = { repository = "rust-lang-libs/tempdir" }
22
22
23
23
[dependencies ]
24
24
rand = " 0.3"
25
+ remove_dir_all = " 0.2"
26
+
Original file line number Diff line number Diff line change 58
58
//! ```
59
59
60
60
extern crate rand;
61
+ extern crate remove_dir_all;
61
62
62
63
use std:: env;
63
64
use std:: io:: { self , Error , ErrorKind } ;
64
65
use std:: fmt;
65
66
use std:: fs;
66
67
use std:: path:: { self , PathBuf , Path } ;
67
68
use rand:: { thread_rng, Rng } ;
69
+ use remove_dir_all:: remove_dir_all;
68
70
69
71
/// A directory in the filesystem that is automatically deleted when
70
72
/// it goes out of scope.
@@ -321,7 +323,7 @@ impl TempDir {
321
323
/// # }
322
324
/// ```
323
325
pub fn close ( mut self ) -> io:: Result < ( ) > {
324
- let result = fs :: remove_dir_all ( self . path ( ) ) ;
326
+ let result = remove_dir_all ( self . path ( ) ) ;
325
327
326
328
// Prevent the Drop impl from removing the dir a second time.
327
329
self . path = None ;
@@ -348,7 +350,7 @@ impl Drop for TempDir {
348
350
fn drop ( & mut self ) {
349
351
// Path is `None` if `close()` or `into_path()` has been called.
350
352
if let Some ( ref p) = self . path {
351
- let _ = fs :: remove_dir_all ( p) ;
353
+ let _ = remove_dir_all ( p) ;
352
354
}
353
355
}
354
356
}
You can’t perform that action at this time.
0 commit comments