about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/directoryservice/memory.rs10
-rw-r--r--tvix/store/src/tests/utils.rs2
2 files changed, 2 insertions, 10 deletions
diff --git a/tvix/store/src/directoryservice/memory.rs b/tvix/store/src/directoryservice/memory.rs
index 34ee45203320..87cd038888e6 100644
--- a/tvix/store/src/directoryservice/memory.rs
+++ b/tvix/store/src/directoryservice/memory.rs
@@ -6,19 +6,11 @@ use tracing::{instrument, warn};
 
 use super::DirectoryService;
 
-#[derive(Clone)]
+#[derive(Clone, Default)]
 pub struct MemoryDirectoryService {
     db: Arc<RwLock<HashMap<Vec<u8>, proto::Directory>>>,
 }
 
-impl MemoryDirectoryService {
-    pub fn new() -> Self {
-        let db = Arc::new(RwLock::new(HashMap::default()));
-
-        Self { db }
-    }
-}
-
 impl DirectoryService for MemoryDirectoryService {
     // TODO: change api to only be by digest
     #[instrument(skip(self, by_what))]
diff --git a/tvix/store/src/tests/utils.rs b/tvix/store/src/tests/utils.rs
index 0b4a85a3af65..6cf888c9d666 100644
--- a/tvix/store/src/tests/utils.rs
+++ b/tvix/store/src/tests/utils.rs
@@ -14,7 +14,7 @@ pub fn gen_chunk_service() -> impl ChunkService + Clone {
 }
 
 pub fn gen_directory_service() -> impl DirectoryService + Send + Sync + Clone + 'static {
-    MemoryDirectoryService::new()
+    MemoryDirectoryService::default()
 }
 
 pub fn gen_pathinfo_service() -> impl PathInfoService {