summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-04-13 23:00:04 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-04-13 23:00:06 +0200
commit526885ee191e8891755ec0b4089bdf52c66933bd (patch)
tree986cca612d215660e5fd1c4f58ddd2f1785c2cb2
parentde522ec0f2acc4e3651f77fdbe7f5295b6702c0d (diff)
downloadimag-526885ee191e8891755ec0b4089bdf52c66933bd.zip
imag-526885ee191e8891755ec0b4089bdf52c66933bd.tar.gz
Fix: PathIterBuilder should not yield directories
PathIterBuilder should yield iterator that does only yield file pathes, not directories. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/core/libimagstore/src/file_abstraction/fs.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs
index 9877474..904e81d 100644
--- a/lib/core/libimagstore/src/file_abstraction/fs.rs
+++ b/lib/core/libimagstore/src/file_abstraction/fs.rs
@@ -176,6 +176,10 @@ impl PathIterBuilder for WalkDirPathIterBuilder {
.min_depth(1)
.max_open(100)
.into_iter()
+ .filter(|r| match r {
+ Err(_) => true,
+ Ok(path) => path.file_type().is_file(),
+ })
.map(|r| {
trace!("Working in PathIterator with {:?}", r);
r.map(|e| PathBuf::from(e.path()))