feat(nix-compat/nixhash): digest_length is const

Change-Id: I565f70b4dd7d44b176a1d6fe5009fdf5346c5ab6
Reviewed-on: https://cl.snix.dev/c/snix/+/30561
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
This commit is contained in:
Florian Klink 2025-06-04 22:35:36 +03:00 committed by clbot
parent 2dfbfebb47
commit 4a63d85b06

View file

@ -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,