about summary refs log tree commit diff
path: root/tvix/store/src/chunkservice/memory.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-03-10T11·21+0100
committerclbot <clbot@tvl.fyi>2023-03-10T12·13+0000
commitb3d6e70909eaa691d98f75a58e2912e59f3536f7 (patch)
tree14b97c7f27d8f71ed7bd455cc93bbbbee90f796c /tvix/store/src/chunkservice/memory.rs
parente716bd09579208f17c016bb265fc92bacc1b1216 (diff)
refactor(tvix/store): impl Default for MemoryChunkService r/5942
Change-Id: If1ceb870e9e5d03b651923a3a786350a8663e990
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8236
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/src/chunkservice/memory.rs')
-rw-r--r--tvix/store/src/chunkservice/memory.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/tvix/store/src/chunkservice/memory.rs b/tvix/store/src/chunkservice/memory.rs
index 1ae8b9130565..8364e434461f 100644
--- a/tvix/store/src/chunkservice/memory.rs
+++ b/tvix/store/src/chunkservice/memory.rs
@@ -9,19 +9,11 @@ use crate::Error;
 
 use super::ChunkService;
 
-#[derive(Clone)]
+#[derive(Clone, Default)]
 pub struct MemoryChunkService {
     db: Arc<RwLock<HashMap<Vec<u8>, Vec<u8>>>>,
 }
 
-impl MemoryChunkService {
-    pub fn new() -> Self {
-        let db = Arc::new(RwLock::new(HashMap::default()));
-
-        Self { db }
-    }
-}
-
 impl ChunkService for MemoryChunkService {
     #[instrument(skip(self, digest), fields(chunk.digest=BASE64.encode(digest)))]
     fn has(&self, digest: &[u8]) -> Result<bool, Error> {