From fdd7817aad18346197a521593bdafdae4045aeb6 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 31 Dec 2023 18:54:44 +0200 Subject: feat(nix-compat/store_path): build_ca_path may fail Change-Id: Ia74ee870f38b7966501458bace541092256c3213 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10509 Reviewed-by: raitobezarius Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/nix-compat/src/store_path/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/nix-compat') diff --git a/tvix/nix-compat/src/store_path/utils.rs b/tvix/nix-compat/src/store_path/utils.rs index af593d27af..0b75ef5064 100644 --- a/tvix/nix-compat/src/store_path/utils.rs +++ b/tvix/nix-compat/src/store_path/utils.rs @@ -115,14 +115,14 @@ pub fn build_ca_path<'a, S: AsRef, I: IntoIterator>( } /// For given NAR sha256 digest and name, return the new [StorePathRef] this -/// would have. +/// would have, or an error, in case the name is invalid. pub fn build_nar_based_store_path<'a>( nar_sha256_digest: &[u8; 32], name: &'a str, -) -> StorePathRef<'a> { +) -> Result, BuildStorePathError> { let nar_hash_with_mode = CAHash::Nar(NixHash::Sha256(nar_sha256_digest.to_owned())); - build_ca_path(name, &nar_hash_with_mode, Vec::::new(), false).unwrap() + build_ca_path(name, &nar_hash_with_mode, Vec::::new(), false) } /// This builds an input-addressed store path. -- cgit 1.4.1