From 526885ee191e8891755ec0b4089bdf52c66933bd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 13 Apr 2019 23:00:04 +0200 Subject: [PATCH] Fix: PathIterBuilder should not yield directories PathIterBuilder should yield iterator that does only yield file pathes, not directories. Signed-off-by: Matthias Beyer --- lib/core/libimagstore/src/file_abstraction/fs.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs index 9877474d..904e81d0 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()))