From c2e52c20c02835ede0fa8ffba89e4af15472f3cf Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Fri, 4 Oct 2024 13:57:21 +0400 Subject: [PATCH] Default value for size as NonZeroUsize --- src/hasher/options/k12_options.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hasher/options/k12_options.rs b/src/hasher/options/k12_options.rs index ebdba9e..fb78cf3 100644 --- a/src/hasher/options/k12_options.rs +++ b/src/hasher/options/k12_options.rs @@ -4,7 +4,10 @@ use anyhow::Context; use super::{common::OUTPUT_SIZE_KEY, traits::HashingOptions}; -pub const DEFAULT_OUTPUT_SIZE: usize = 32; +pub const DEFAULT_OUTPUT_SIZE: NonZeroUsize = match NonZeroUsize::new(32) { + Some(v) => v, + None => unreachable!(), +}; pub struct K12Options { pub output_size: NonZeroUsize,