diff options
Diffstat (limited to 'src/walk.rs')
-rw-r--r-- | src/walk.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/walk.rs b/src/walk.rs index 524e6f0b..e60e2605 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -4,8 +4,6 @@ crate that can efficiently skip and ignore files and directories specified in a user's ignore patterns. */ -use std::path::PathBuf; - use walkdir::{self, DirEntry, WalkDir, WalkDirIterator}; use ignore::Ignore; @@ -41,9 +39,9 @@ impl Iter { } impl Iterator for Iter { - type Item = PathBuf; + type Item = DirEntry; - fn next(&mut self) -> Option<PathBuf> { + fn next(&mut self) -> Option<DirEntry> { while let Some(ev) = self.it.next() { match ev { Err(err) => { @@ -76,11 +74,7 @@ impl Iterator for Iter { if !ent.file_type().is_file() { continue; } - let mut path = ent.path(); - if let Ok(p) = path.strip_prefix("./") { - path = p; - } - return Some(path.to_path_buf()); + return Some(ent); } } } |