From 8e97c0deb056dfe29feff9aefcc524c0f2f36355 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 10 Mar 2023 12:19:20 +0100 Subject: refactor(tvix/store): impl Default for MemoryPathInfoService Change-Id: I07f83f8aaa6312cc37ce7e7ee2b713e60df23782 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8234 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/store/src/pathinfoservice/memory.rs | 9 +-------- tvix/store/src/tests/utils.rs | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'tvix/store') 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, 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() } -- cgit 1.4.1