about summary refs log tree commit diff
path: root/tvix/nix-compat/src/nixhash
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/nix-compat/src/nixhash')
-rw-r--r--tvix/nix-compat/src/nixhash/ca_hash.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tvix/nix-compat/src/nixhash/ca_hash.rs b/tvix/nix-compat/src/nixhash/ca_hash.rs
index 5d9ae3f3a861..93ef52cc63ab 100644
--- a/tvix/nix-compat/src/nixhash/ca_hash.rs
+++ b/tvix/nix-compat/src/nixhash/ca_hash.rs
@@ -19,17 +19,17 @@ use super::from_algo_and_digest;
 ///  - "digest". The digest itself.
 #[derive(Clone, Debug, Eq, PartialEq)]
 pub enum CAHash {
-    Flat(NixHash),       // "fixed flat"
-    Nar(NixHash),        // "fixed recursive"
-    Text(Box<[u8; 32]>), // "text", only supports sha256
+    Flat(NixHash),  // "fixed flat"
+    Nar(NixHash),   // "fixed recursive"
+    Text([u8; 32]), // "text", only supports sha256
 }
 
 impl CAHash {
     pub fn digest(&self) -> Cow<NixHash> {
-        match self {
-            CAHash::Nar(ref digest) => Cow::Borrowed(digest),
-            CAHash::Text(ref digest) => Cow::Owned(NixHash::Sha256(*digest.clone())),
+        match *self {
             CAHash::Flat(ref digest) => Cow::Borrowed(digest),
+            CAHash::Nar(ref digest) => Cow::Borrowed(digest),
+            CAHash::Text(digest) => Cow::Owned(NixHash::Sha256(digest)),
         }
     }