From 7f6f4581946f9ae8e2c23cd7e09eb4f03d6c3cb1 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Wed, 3 Feb 2016 18:23:33 +0100 Subject: Adress comments --- src/libstd/sys/unix/fs.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/libstd/sys/unix') 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) -- cgit 1.4.1-3-g733a5