about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/nixpath.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/tvix/store/src/nixpath.rs b/tvix/store/src/nixpath.rs
index 8232e3241e11..44350803eafa 100644
--- a/tvix/store/src/nixpath.rs
+++ b/tvix/store/src/nixpath.rs
@@ -49,13 +49,9 @@ impl NixPath {
 
         NixPath::validate_characters(&s[name_offset..])?;
 
-        // copy the digest:Vec<u8> to a [u8; PATH_HASH_SIZE]
-        let mut buffer: [u8; PATH_HASH_SIZE] = [0; PATH_HASH_SIZE];
-        buffer[..PATH_HASH_SIZE].copy_from_slice(&digest[..PATH_HASH_SIZE]);
-
         Ok(NixPath {
             name: s[name_offset..].to_string(),
-            digest: buffer,
+            digest: digest.try_into().expect("size is known"),
         })
     }