From bc7b701de3c61bd035b04f0c6a15e0fc9490d060 Mon Sep 17 00:00:00 2001 From: Eugene P Date: Thu, 10 Jan 2019 12:55:10 +0300 Subject: [PATCH] Show full hex string of hash in fmt::Debug for core::Hash --- core/src/core/hash.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/core/hash.rs b/core/src/core/hash.rs index 62170624..8c38f9d7 100644 --- a/core/src/core/hash.rs +++ b/core/src/core/hash.rs @@ -38,10 +38,7 @@ pub struct Hash([u8; 32]); impl fmt::Debug for Hash { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - for i in self.0[..4].iter() { - write!(f, "{:02x}", i)?; - } - Ok(()) + write!(f, "{}", self.to_hex()) } }