summaryrefslogtreecommitdiffstats
path: root/src/filestore/staging.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-06-20 19:16:10 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-08-18 10:07:18 +0200
commit29421212f21dec376b31ca3ac51cc45798fe5580 (patch)
treec22fa58e92a9b9bbb5df783c9e6850b568a22c53 /src/filestore/staging.rs
parentbb6206a1c5625fcdd2ccbf8ab1f5abb65fe05bc5 (diff)
Refactor: Simplify implementation
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/filestore/staging.rs')
-rw-r--r--src/filestore/staging.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/filestore/staging.rs b/src/filestore/staging.rs
index af62980..ff4b17c 100644
--- a/src/filestore/staging.rs
+++ b/src/filestore/staging.rs
@@ -64,14 +64,14 @@ impl StagingStore {
if self.0.root_path().is_dir(&path) {
None
} else {
- Some({
- // Clippy doesn't detect this properly
- #[allow(clippy::redundant_clone)]
- ArtifactPath::new(path.to_path_buf())
- .inspect(|r| trace!("Loaded from path {} = {:?}", path.display(), r))
- .with_context(|| anyhow!("Loading from path: {}", path.display()))
- .map(|ap| self.0.load_from_path(&ap).clone())
- })
+ // Clippy doesn't detect this properly
+ #[allow(clippy::redundant_clone)]
+ ArtifactPath::new(path.to_path_buf())
+ .inspect(|r| trace!("Loaded from path {} = {:?}", path.display(), r))
+ .with_context(|| anyhow!("Loading from path: {}", path.display()))
+ .map(|ap| self.0.load_from_path(&ap).clone())
+ .map(Some)
+ .transpose()
}
})
.collect()