Use hex-conservative to display pubkey

We introduced `hex-conservative` ages ago, use it to display the
`PublicKey`.
This commit is contained in:
Tobin C. Harding 2024-01-23 16:59:22 +11:00
parent d08d3efdfa
commit c82f26e960
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 5 deletions

View File

@ -220,12 +220,8 @@ pub struct SortKey(ArrayVec<u8, 65>);
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)
})
}
}