From 4ae0f428bd207fdf3730d0f6ff73c7410ae9cd7b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 14 Oct 2023 17:48:16 +0100 Subject: refactor(tvix/nix-compat): make NixHash an enum with fixed-len bytes Less Vec passed around. Change-Id: Ie153a6bfaa084d7490ffa38634efdf5f3c31a768 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9722 Reviewed-by: Connor Brewster Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/output.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/nix-compat/src/derivation/output.rs') 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())); } } } -- cgit 1.4.1