diff options
author | Florian Klink <flokli@flokli.de> | 2023-03-10T11·20+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-03-10T12·13+0000 |
commit | e716bd09579208f17c016bb265fc92bacc1b1216 (patch) | |
tree | c1823227e9632a6f266488dfe11d3f43a68ac2e5 /tvix/store/src/directoryservice/memory.rs | |
parent | 8e97c0deb056dfe29feff9aefcc524c0f2f36355 (diff) |
refactor(tvix/store): impl Default for MemoryDirectoryService r/5941
Change-Id: Ie75a1e67c8c0499ff10f60d90251b768937dad3a Reviewed-on: https://cl.tvl.fyi/c/depot/+/8235 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/directoryservice/memory.rs')
-rw-r--r-- | tvix/store/src/directoryservice/memory.rs | 10 |
1 files changed, 1 insertions, 9 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))] |