summaryrefslogtreecommitdiff
path: root/src/indexedstore.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/indexedstore.rs')
-rw-r--r--src/indexedstore.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/indexedstore.rs b/src/indexedstore.rs
index 4cc90cc..5a41406 100644
--- a/src/indexedstore.rs
+++ b/src/indexedstore.rs
@@ -2,7 +2,7 @@ use crate::chunk::DataChunk;
use crate::chunkid::ChunkId;
use crate::chunkmeta::ChunkMeta;
use crate::index::Index;
-use crate::store::Store;
+use crate::store::{LoadedChunk, Store};
use std::path::Path;
/// A store for chunks and their metadata.
@@ -31,7 +31,7 @@ impl IndexedStore {
Ok(id)
}
- pub fn load(&self, id: &ChunkId) -> anyhow::Result<(ChunkMeta, DataChunk)> {
+ pub fn load(&self, id: &ChunkId) -> anyhow::Result<LoadedChunk> {
self.store.load(id)
}
@@ -48,8 +48,8 @@ impl IndexedStore {
}
pub fn remove(&mut self, id: &ChunkId) -> anyhow::Result<()> {
- let (meta, _) = self.store.load(id)?;
- self.index.remove("sha256", meta.sha256());
+ let loaded = self.store.load(id)?;
+ self.index.remove("sha256", loaded.meta().sha256());
self.index.remove_generation(id);
self.store.delete(id)?;
Ok(())