From 7f7c1ae7be97a54e8a52bda29e6d2c22f2efb822 Mon Sep 17 00:00:00 2001 From: edef Date: Fri, 27 Oct 2023 11:35:09 +0000 Subject: refactor(nix-compat/store_path): make digest and name private Change-Id: I62cbe883afcf3dd0c8d4de0e3b845069eb750c97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9855 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/store/src/pathinfoservice/memory.rs | 2 +- tvix/store/src/pathinfoservice/sled.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'tvix/store/src/pathinfoservice') diff --git a/tvix/store/src/pathinfoservice/memory.rs b/tvix/store/src/pathinfoservice/memory.rs index dbb4b02dd0..d18453477a 100644 --- a/tvix/store/src/pathinfoservice/memory.rs +++ b/tvix/store/src/pathinfoservice/memory.rs @@ -74,7 +74,7 @@ impl PathInfoService for MemoryPathInfoService { // This overwrites existing PathInfo objects. Ok(nix_path) => { let mut db = self.db.write().unwrap(); - db.insert(nix_path.digest, path_info.clone()); + db.insert(*nix_path.digest(), path_info.clone()); Ok(path_info) } diff --git a/tvix/store/src/pathinfoservice/sled.rs b/tvix/store/src/pathinfoservice/sled.rs index bac384ea09..fce0b7f441 100644 --- a/tvix/store/src/pathinfoservice/sled.rs +++ b/tvix/store/src/pathinfoservice/sled.rs @@ -119,7 +119,10 @@ impl PathInfoService for SledPathInfoService { ))), // In case the PathInfo is valid, and we were able to extract a NixPath, store it in the database. // This overwrites existing PathInfo objects. - Ok(nix_path) => match self.db.insert(nix_path.digest, path_info.encode_to_vec()) { + Ok(nix_path) => match self + .db + .insert(*nix_path.digest(), path_info.encode_to_vec()) + { Ok(_) => Ok(path_info), Err(e) => { warn!("failed to insert PathInfo: {}", e); -- cgit 1.4.1