about summary refs log tree commit diff
path: root/tvix/glue/src/known_paths.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/glue/src/known_paths.rs')
-rw-r--r--tvix/glue/src/known_paths.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tvix/glue/src/known_paths.rs b/tvix/glue/src/known_paths.rs
index b0a4c0ac7129..626b320ed515 100644
--- a/tvix/glue/src/known_paths.rs
+++ b/tvix/glue/src/known_paths.rs
@@ -8,7 +8,7 @@
 //! This data is required to find the derivation needed to actually trigger the
 //! build, if necessary.
 
-use nix_compat::nixhash::NixHash;
+use nix_compat::{nixhash::NixHash, store_path::StorePath};
 use std::collections::HashMap;
 
 #[derive(Debug, Default)]
@@ -16,26 +16,26 @@ pub struct KnownPaths {
     /// All known derivation or FOD hashes.
     ///
     /// Keys are derivation paths, values is the NixHash.
-    derivation_or_fod_hashes: HashMap<String, NixHash>,
+    derivation_or_fod_hashes: HashMap<StorePath, NixHash>,
 }
 
 impl KnownPaths {
     /// Fetch the opaque "hash derivation modulo" for a given derivation path.
-    pub fn get_hash_derivation_modulo(&self, drv_path: &str) -> NixHash {
+    pub fn get_hash_derivation_modulo(&self, drv_path: &StorePath) -> NixHash {
         // TODO: we rely on an invariant that things *should* have
         // been calculated if we get this far.
         self.derivation_or_fod_hashes[drv_path].clone()
     }
 
-    pub fn add_hash_derivation_modulo<D: ToString>(
+    pub fn add_hash_derivation_modulo(
         &mut self,
-        drv: D,
+        drv_path: StorePath,
         hash_derivation_modulo: &NixHash,
     ) {
         #[allow(unused_variables)] // assertions on this only compiled in debug builds
         let old = self
             .derivation_or_fod_hashes
-            .insert(drv.to_string(), hash_derivation_modulo.to_owned());
+            .insert(drv_path, hash_derivation_modulo.to_owned());
 
         #[cfg(debug_assertions)]
         {