diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-06-20 19:16:10 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-08-18 10:07:18 +0200 |
commit | 29421212f21dec376b31ca3ac51cc45798fe5580 (patch) | |
tree | c22fa58e92a9b9bbb5df783c9e6850b568a22c53 /src/filestore/staging.rs | |
parent | bb6206a1c5625fcdd2ccbf8ab1f5abb65fe05bc5 (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.rs | 16 |
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() |