From f5f3e505076ff8f7e230203c54a20a939111a5ba Mon Sep 17 00:00:00 2001 From: "thesimplekid (aider)" Date: Sun, 13 Apr 2025 22:19:41 +0100 Subject: [PATCH] fix: Correct mnemonic hashing in Debug implementation --- crates/cdk-mintd/src/config.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/cdk-mintd/src/config.rs b/crates/cdk-mintd/src/config.rs index 2aec65bf..8d0fc299 100644 --- a/crates/cdk-mintd/src/config.rs +++ b/crates/cdk-mintd/src/config.rs @@ -27,10 +27,9 @@ pub struct Info { impl std::fmt::Debug for Info { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // Use a fallback approach that won't panic - let mnemonic_display = match sha256::Hash::hash(self.mnemonic.clone().into_bytes().as_ref()) - { - Ok(hash) => format!("", hash), - Err(_) => String::from(""), // Fallback if hashing fails + let mnemonic_display = { + let hash = sha256::Hash::hash(self.mnemonic.clone().into_bytes().as_ref()); + format!("", hash) }; f.debug_struct("Info")