diff options
-rw-r--r-- | src/filestore/path.rs | 9 | ||||
-rw-r--r-- | src/filestore/staging.rs | 2 | ||||
-rw-r--r-- | src/filestore/util.rs | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/filestore/path.rs b/src/filestore/path.rs index ea06608..fd79e1b 100644 --- a/src/filestore/path.rs +++ b/src/filestore/path.rs @@ -25,9 +25,12 @@ impl StoreRoot { FullArtifactPath(&self, ap) } - // Needed for FileStoreImpl::path_exists_in_store_root() - pub (in crate::filestore) fn join_path(&self, p: &Path) -> PathBuf { - self.0.join(p) + pub fn is_file(&self, subpath: &Path) -> bool { + self.0.join(subpath).is_file() + } + + pub fn is_dir(&self, subpath: &Path) -> bool { + self.0.join(subpath).is_dir() } pub fn display(&self) -> std::path::Display { diff --git a/src/filestore/staging.rs b/src/filestore/staging.rs index 992a612..df7e006 100644 --- a/src/filestore/staging.rs +++ b/src/filestore/staging.rs @@ -66,7 +66,7 @@ impl StagingStore { .into_iter() .inspect(|p| trace!("Trying to load into staging store: {}", p.display())) .filter_map(|path| { - if self.0.root.join_path(&path).is_dir() { + if self.0.root.is_dir(&path) { None } else { Some({ diff --git a/src/filestore/util.rs b/src/filestore/util.rs index 1899c18..0eb430e 100644 --- a/src/filestore/util.rs +++ b/src/filestore/util.rs @@ -55,7 +55,7 @@ impl FileStoreImpl { } pub fn path_exists_in_store_root(&self, p: &Path) -> bool { - self.root.join_path(p).is_file() + self.root.is_file(p) } pub (in crate::filestore) fn values(&self) -> impl Iterator<Item = &Artifact> { |