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) }) } }