File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 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<()> {
10991099/// # Examples
11001100///
11011101/// ```
1102- /// # #![feature(path_ext)]
11031102/// use std::io;
1104- /// use std::fs::{self, PathExt, DirEntry};
1103+ /// use std::fs::{self, DirEntry};
11051104/// use std::path::Path;
11061105///
11071106/// // 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() {
11101109/// for entry in try!(fs::read_dir(dir)) {
11111110/// let entry = try!(entry);
1112- /// if entry.path().is_dir() {
1111+ /// if try!(fs::metadata( entry.path()) ).is_dir() {
11131112/// try!(visit_dirs(&entry.path(), cb));
11141113/// } else {
1115- /// cb(entry);
1114+ /// cb(& entry);
11161115/// }
11171116/// }
11181117/// }
You can’t perform that action at this time.
0 commit comments