summaryrefslogtreecommitdiffstats
path: root/src/filestore/staging.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-07 13:31:37 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-07 13:31:37 +0100
commit83cd6aedb2e5e76ff9ee8ce009dda122f4379fbd (patch)
tree8e1d5f606fc7f95e1822a45a89a2bdfdc3954875 /src/filestore/staging.rs
parentbbf93e26f836927c3f6bd341abedc92b71867e09 (diff)
Make stores only loadable with StoreRoot object
This patch changes the interfaces to no load the StoreRoot object internally, but getting it from the caller. The StoreRoot::new() function got more restrictive, to only be able to load the StoreRoot object when pointing to an existing directory. This makes is_dir() checks during the runtime unecessary, which reduces runtime overall, because this test is only done once during construction, not N times during usage of the store objects. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/filestore/staging.rs')
-rw-r--r--src/filestore/staging.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filestore/staging.rs b/src/filestore/staging.rs
index 93c4047..d474d1a 100644
--- a/src/filestore/staging.rs
+++ b/src/filestore/staging.rs
@@ -25,7 +25,7 @@ impl Debug for StagingStore {
}
impl StagingStore {
- pub fn load(root: &Path, progress: ProgressBar) -> Result<Self> {
+ pub fn load(root: StoreRoot, progress: ProgressBar) -> Result<Self> {
FileStoreImpl::load(root, progress).map(StagingStore)
}