diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index eb3af41a..fb20eaf8 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -220,12 +220,8 @@ pub struct SortKey(ArrayVec); impl fmt::Display for PublicKey { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // TODO: fast hex encoding self.with_serialized(|bytes| { - for ch in bytes { - write!(f, "{:02x}", ch)?; - } - Ok(()) + fmt::Display::fmt(&bytes.as_hex(), f) }) } } diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 3ae3ee6b..d0990b05 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -832,7 +832,6 @@ impl crate::serde::Serialize for U256 { } if serializer.is_human_readable() { - // TODO: fast hex encoding. serializer.collect_str(&DisplayHex(*self)) } else { let bytes = self.to_be_bytes();