Use hex-conservative to display pubkey
We introduced `hex-conservative` ages ago, use it to display the `PublicKey`.
This commit is contained in:
parent
d08d3efdfa
commit
c82f26e960
|
@ -220,12 +220,8 @@ pub struct SortKey(ArrayVec<u8, 65>);
|
||||||
|
|
||||||
impl fmt::Display for PublicKey {
|
impl fmt::Display for PublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
// TODO: fast hex encoding
|
|
||||||
self.with_serialized(|bytes| {
|
self.with_serialized(|bytes| {
|
||||||
for ch in bytes {
|
fmt::Display::fmt(&bytes.as_hex(), f)
|
||||||
write!(f, "{:02x}", ch)?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue