diff options
| author | Paul Dicker <pitdicker@gmail.com> | 2016-02-03 18:23:33 +0100 |
|---|---|---|
| committer | Paul Dicker <pitdicker@gmail.com> | 2016-02-03 18:23:33 +0100 |
| commit | 7f6f4581946f9ae8e2c23cd7e09eb4f03d6c3cb1 (patch) | |
| tree | 84f92ea71bd466e128528d52e61fbc3a352b97a7 /src/libstd/sys/unix | |
| parent | cdb1df749e848c2d0e0a87fa6140aa7c74220b80 (diff) | |
| download | rust-7f6f4581946f9ae8e2c23cd7e09eb4f03d6c3cb1.tar.gz rust-7f6f4581946f9ae8e2c23cd7e09eb4f03d6c3cb1.zip | |
Adress comments
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index f7989d35710..a2e6f467b17 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -512,12 +512,11 @@ pub fn rmdir(p: &Path) -> io::Result<()> { pub fn remove_dir_all(path: &Path) -> io::Result<()> { for child in try!(readdir(path)) { - let child = try!(child).path(); - let stat = try!(lstat(&*child)); - if stat.file_type().is_dir() { - try!(remove_dir_all(&*child)); + let child = try!(child); + if try!(child.file_type()).is_dir() { + try!(remove_dir_all(&child.path())); } else { - try!(unlink(&*child)); + try!(unlink(&child.path())); } } rmdir(path) |
