diff --git a/lib/config/src/hash.rs b/lib/config/src/hash.rs index a7475ae3fd1..880edf0d071 100644 --- a/lib/config/src/hash.rs +++ b/lib/config/src/hash.rs @@ -1,5 +1,5 @@ /// Sha256 hash, represented as bytes. -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Sha256Hash(pub [u8; 32]); impl Sha256Hash { @@ -33,6 +33,12 @@ impl std::str::FromStr for Sha256Hash { } } +impl std::fmt::Debug for Sha256Hash { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Sha256({})", hex::encode(self.0)) + } +} + impl std::fmt::Display for Sha256Hash { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", hex::encode(self.0))