Fix Walkdir depth
From the documentation of Walkdir::min_depth(): Set the minimum depth of entries yielded by the iterator. The smallest depth is 0 and always corresponds to the path given to the new function on this type. Its direct descendents have depth 1, and their descendents have depth 2, and so on. This means that when we started with "/tmp/store", we end up yielding that exact path in the first iteration. This is exactly what we do _not_ want. Setting the minimal depth to 1 fixes this bug.
This commit is contained in:
parent
5a868015e6
commit
555c0bb1df
1 changed files with 1 additions and 0 deletions
|
@ -159,6 +159,7 @@ impl FileAbstraction for FSFileAbstraction {
|
|||
use walkdir::WalkDir;
|
||||
|
||||
let i : Result<Vec<PathBuf>, SE> = WalkDir::new(basepath)
|
||||
.min_depth(1)
|
||||
.into_iter()
|
||||
.map(|r| {
|
||||
r.map(|e| PathBuf::from(e.path()))
|
||||
|
|
Loading…
Reference in a new issue