diff options
author | Florian Klink <flokli@flokli.de> | 2023-03-10T11·19+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-03-10T12·13+0000 |
commit | 8e97c0deb056dfe29feff9aefcc524c0f2f36355 (patch) | |
tree | 43159b06b199b8e5a653472510aef1302331511a | |
parent | 510927e43a950e727c31e100f1e88f0d8a80b6b9 (diff) |
refactor(tvix/store): impl Default for MemoryPathInfoService r/5940
Change-Id: I07f83f8aaa6312cc37ce7e7ee2b713e60df23782 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8234 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r-- | tvix/store/src/pathinfoservice/memory.rs | 9 | ||||
-rw-r--r-- | tvix/store/src/tests/utils.rs | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/tvix/store/src/pathinfoservice/memory.rs b/tvix/store/src/pathinfoservice/memory.rs index db31a2d7718c..4ac21883823b 100644 --- a/tvix/store/src/pathinfoservice/memory.rs +++ b/tvix/store/src/pathinfoservice/memory.rs @@ -8,18 +8,11 @@ use nix_compat::store_path::DIGEST_SIZE; use super::PathInfoService; +#[derive(Default)] pub struct MemoryPathInfoService { db: Arc<RwLock<HashMap<Vec<u8>, proto::PathInfo>>>, } -impl MemoryPathInfoService { - pub fn new() -> Self { - let db = Arc::new(RwLock::new(HashMap::default())); - - Self { db } - } -} - impl PathInfoService for MemoryPathInfoService { fn get( &self, diff --git a/tvix/store/src/tests/utils.rs b/tvix/store/src/tests/utils.rs index ac801b47aad2..0b4a85a3af65 100644 --- a/tvix/store/src/tests/utils.rs +++ b/tvix/store/src/tests/utils.rs @@ -18,5 +18,5 @@ pub fn gen_directory_service() -> impl DirectoryService + Send + Sync + Clone + } pub fn gen_pathinfo_service() -> impl PathInfoService { - MemoryPathInfoService::new() + MemoryPathInfoService::default() } |