File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1099,20 +1099,19 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
1099
1099
/// # Examples
1100
1100
///
1101
1101
/// ```
1102
- /// # #![feature(path_ext)]
1103
1102
/// use std::io;
1104
- /// use std::fs::{self, PathExt, DirEntry};
1103
+ /// use std::fs::{self, DirEntry};
1105
1104
/// use std::path::Path;
1106
1105
///
1107
1106
/// // one possible implementation of fs::walk_dir only visiting files
1108
- /// fn visit_dirs(dir: &Path, cb: &mut FnMut( DirEntry)) -> io::Result<()> {
1109
- /// if dir.is_dir() {
1107
+ /// fn visit_dirs(dir: &Path, cb: &Fn(& DirEntry)) -> io::Result<()> {
1108
+ /// if try!(fs::metadata( dir)) .is_dir() {
1110
1109
/// for entry in try!(fs::read_dir(dir)) {
1111
1110
/// let entry = try!(entry);
1112
- /// if entry.path().is_dir() {
1111
+ /// if try!(fs::metadata( entry.path()) ).is_dir() {
1113
1112
/// try!(visit_dirs(&entry.path(), cb));
1114
1113
/// } else {
1115
- /// cb(entry);
1114
+ /// cb(& entry);
1116
1115
/// }
1117
1116
/// }
1118
1117
/// }
You can’t perform that action at this time.
0 commit comments