summaryrefslogtreecommitdiffstats
path: root/src/walk.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-09-05 10:15:13 -0400
committerAndrew Gallant <jamslam@gmail.com>2016-09-05 10:15:13 -0400
commitd8d7560fd082ce2f2e004b70c7993b4eaac25033 (patch)
tree5dc227a366fa17aa699ba51ee3d490654ff76056 /src/walk.rs
parent812cdb13c63441e2eddcaccdf632fdfb7c806a95 (diff)
TODOs and some cleanup/refactoring.
Diffstat (limited to 'src/walk.rs')
-rw-r--r--src/walk.rs12
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);
}
}
}