Procházet zdrojové kódy

fix: Correct mnemonic hashing in Debug implementation

thesimplekid (aider) před 1 měsícem
rodič
revize
f5f3e50507
1 změnil soubory, kde provedl 3 přidání a 4 odebrání
  1. 3 4
      crates/cdk-mintd/src/config.rs

+ 3 - 4
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!("<hashed: {}>", hash),
-            Err(_) => String::from("<protected>"), // Fallback if hashing fails
+        let mnemonic_display = {
+            let hash = sha256::Hash::hash(self.mnemonic.clone().into_bytes().as_ref());
+            format!("<hashed: {}>", hash)
         };
 
         f.debug_struct("Info")