diff options
Diffstat (limited to 'tvix/nix-compat/src/store_path')
-rw-r--r-- | tvix/nix-compat/src/store_path/mod.rs | 2 | ||||
-rw-r--r-- | tvix/nix-compat/src/store_path/utils.rs | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tvix/nix-compat/src/store_path/mod.rs b/tvix/nix-compat/src/store_path/mod.rs index 177cc96ce20f..546c34d93615 100644 --- a/tvix/nix-compat/src/store_path/mod.rs +++ b/tvix/nix-compat/src/store_path/mod.rs @@ -139,7 +139,7 @@ where S: From<&'a str>, { Ok(Self { - name: validate_name(name.as_bytes())?.into(), + name: validate_name(name)?.into(), digest, }) } diff --git a/tvix/nix-compat/src/store_path/utils.rs b/tvix/nix-compat/src/store_path/utils.rs index 4bfbb72fcdde..3cf3ba06308f 100644 --- a/tvix/nix-compat/src/store_path/utils.rs +++ b/tvix/nix-compat/src/store_path/utils.rs @@ -134,11 +134,14 @@ pub fn build_nar_based_store_path<'a>( /// /// Input-addresed store paths are always derivation outputs, the "input" in question is the /// derivation and its closure. -pub fn build_output_path<'a>( +pub fn build_output_path<'a, SP>( drv_sha256: &[u8; 32], output_name: &str, output_path_name: &'a str, -) -> Result<StorePathRef<'a>, Error> { +) -> Result<StorePath<SP>, Error> +where + SP: std::cmp::Eq + std::ops::Deref<Target = str> + std::convert::From<&'a str>, +{ build_store_path_from_fingerprint_parts( &(String::from("output:") + output_name), drv_sha256, @@ -156,13 +159,13 @@ pub fn build_output_path<'a>( /// bytes. /// Inside a StorePath, that digest is printed nixbase32-encoded /// (32 characters). -fn build_store_path_from_fingerprint_parts<'a, S>( +fn build_store_path_from_fingerprint_parts<'a, SP>( ty: &str, inner_digest: &[u8; 32], name: &'a str, -) -> Result<StorePath<S>, Error> +) -> Result<StorePath<SP>, Error> where - S: std::cmp::Eq + std::ops::Deref<Target = str> + std::convert::From<&'a str>, + SP: std::cmp::Eq + std::ops::Deref<Target = str> + std::convert::From<&'a str>, { let fingerprint = format!( "{ty}:sha256:{}:{STORE_DIR}:{name}", |