about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation/output.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-14T16·48+0100
committerclbot <clbot@tvl.fyi>2023-10-14T17·55+0000
commit4ae0f428bd207fdf3730d0f6ff73c7410ae9cd7b (patch)
tree341376899389f822e4bd40b3843aba8954fc77a3 /tvix/nix-compat/src/derivation/output.rs
parent786b0324a9df1a63606bae72011978fc415f6f07 (diff)
refactor(tvix/nix-compat): make NixHash an enum with fixed-len bytes r/6807
Less Vec<u8> passed around.

Change-Id: Ie153a6bfaa084d7490ffa38634efdf5f3c31a768
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9722
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/derivation/output.rs')
-rw-r--r--tvix/nix-compat/src/derivation/output.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/nix-compat/src/derivation/output.rs b/tvix/nix-compat/src/derivation/output.rs
index 982d8222e90e..78a83b03be45 100644
--- a/tvix/nix-compat/src/derivation/output.rs
+++ b/tvix/nix-compat/src/derivation/output.rs
@@ -44,8 +44,8 @@ impl Output {
         if let Some(hash) = &self.hash_with_mode {
             match hash {
                 NixHashWithMode::Flat(h) | NixHashWithMode::Recursive(h) => {
-                    if h.algo != HashAlgo::Sha1 || h.algo != HashAlgo::Sha256 {
-                        return Err(OutputError::InvalidHashAlgo(h.algo.to_string()));
+                    if h.algo() != HashAlgo::Sha1 || h.algo() != HashAlgo::Sha256 {
+                        return Err(OutputError::InvalidHashAlgo(h.algo().to_string()));
                     }
                 }
             }