From 4a63d85b06d9c7b3783654c4f3bebe7457013437 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 4 Jun 2025 22:35:36 +0300 Subject: [PATCH] feat(nix-compat/nixhash): digest_length is const Change-Id: I565f70b4dd7d44b176a1d6fe5009fdf5346c5ab6 Reviewed-on: https://cl.snix.dev/c/snix/+/30561 Reviewed-by: edef Tested-by: besadii Autosubmit: Florian Klink --- snix/nix-compat/src/nixhash/algos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snix/nix-compat/src/nixhash/algos.rs b/snix/nix-compat/src/nixhash/algos.rs index 1d98eba0a..91410d3dc 100644 --- a/snix/nix-compat/src/nixhash/algos.rs +++ b/snix/nix-compat/src/nixhash/algos.rs @@ -15,7 +15,7 @@ pub enum HashAlgo { impl HashAlgo { // return the number of bytes in the digest of the given hash algo. - pub fn digest_length(&self) -> usize { + pub const fn digest_length(&self) -> usize { match self { HashAlgo::Sha1 => 20, HashAlgo::Sha256 => 32,