diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 734f774043d6d..3c742a9ee56e3 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1341,8 +1341,9 @@ pub fn remove_dir_all>(path: P) -> io::Result<()> { /// if dir.is_dir() { /// for entry in try!(fs::read_dir(dir)) { /// let entry = try!(entry); -/// if try!(entry.file_type()).is_dir() { -/// try!(visit_dirs(&entry.path(), cb)); +/// let path = entry.path(); +/// if path.is_dir() { +/// try!(visit_dirs(&path, cb)); /// } else { /// cb(&entry); /// }