Merge rust-bitcoin/rust-bitcoin#2388: Use hex-conservative to display pubkey
faa45cf10f
Remove stale comment (Tobin C. Harding)c82f26e960
Use hex-conservative to display pubkey (Tobin C. Harding) Pull request description: We introduced `hex-conservative` ages ago, use it to display the `PublicKey`. ACKs for top commit: Kixunil: ACKfaa45cf10f
apoelstra: ACKfaa45cf10f
Tree-SHA512: 8ad14c7697314f8393ecb9a287215c505924d0655f7bf3536d4be83af983b142e06a96f802beb4548e2de051f1783549d8d1d1a8ebfb678f372a54010717752e
This commit is contained in:
commit
53808fa9c9
|
@ -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(())
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -832,7 +832,6 @@ impl crate::serde::Serialize for U256 {
|
||||||
}
|
}
|
||||||
|
|
||||||
if serializer.is_human_readable() {
|
if serializer.is_human_readable() {
|
||||||
// TODO: fast hex encoding.
|
|
||||||
serializer.collect_str(&DisplayHex(*self))
|
serializer.collect_str(&DisplayHex(*self))
|
||||||
} else {
|
} else {
|
||||||
let bytes = self.to_be_bytes();
|
let bytes = self.to_be_bytes();
|
||||||
|
|
Loading…
Reference in New Issue