diff options
Diffstat (limited to 'src/filestore')
-rw-r--r-- | src/filestore/path.rs | 8 | ||||
-rw-r--r-- | src/filestore/util.rs | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/filestore/path.rs b/src/filestore/path.rs index 134c132..80cd043 100644 --- a/src/filestore/path.rs +++ b/src/filestore/path.rs @@ -41,13 +41,13 @@ impl StoreRoot { self.0.join(subpath).is_dir() } - pub (in crate::filestore) fn as_path(&self) -> &Path { - self.0.as_ref() - } - pub fn display(&self) -> std::path::Display { self.0.display() } + + pub (in crate::filestore) fn walk(&self) -> walkdir::WalkDir { + walkdir::WalkDir::new(&self.0) + } } impl AsRef<Path> for StoreRoot { diff --git a/src/filestore/util.rs b/src/filestore/util.rs index 75e3972..90dacab 100644 --- a/src/filestore/util.rs +++ b/src/filestore/util.rs @@ -10,7 +10,6 @@ use anyhow::anyhow; use indicatif::ProgressBar; use resiter::AndThen; use resiter::Map; -use walkdir::WalkDir; use crate::filestore::Artifact; use crate::filestore::path::*; @@ -29,7 +28,7 @@ pub struct FileStoreImpl { impl FileStoreImpl { /// Loads the passed path recursively into a Path => Artifact mapping pub fn load(root: StoreRoot, progress: ProgressBar) -> Result<Self> { - let store = WalkDir::new(root.as_path()) + let store = root.walk() .follow_links(false) .into_iter() .filter_entry(|e| e.file_type().is_file()) |