improved PublicKey debug impl
This commit is contained in:
parent
2a80731446
commit
ca32f7b403
12
src/key.rs
12
src/key.rs
|
@ -144,7 +144,7 @@ impl str::FromStr for SecretKey {
|
||||||
/// ```
|
/// ```
|
||||||
/// [`bincode`]: https://docs.rs/bincode
|
/// [`bincode`]: https://docs.rs/bincode
|
||||||
/// [`cbor`]: https://docs.rs/cbor
|
/// [`cbor`]: https://docs.rs/cbor
|
||||||
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct PublicKey(ffi::PublicKey);
|
pub struct PublicKey(ffi::PublicKey);
|
||||||
impl_fast_comparisons!(PublicKey);
|
impl_fast_comparisons!(PublicKey);
|
||||||
|
@ -163,6 +163,10 @@ impl fmt::Display for PublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for PublicKey {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
||||||
|
}
|
||||||
|
|
||||||
impl str::FromStr for PublicKey {
|
impl str::FromStr for PublicKey {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<PublicKey, Error> {
|
fn from_str(s: &str) -> Result<PublicKey, Error> {
|
||||||
|
@ -1138,7 +1142,7 @@ impl CPtr for Keypair {
|
||||||
/// ```
|
/// ```
|
||||||
/// [`bincode`]: https://docs.rs/bincode
|
/// [`bincode`]: https://docs.rs/bincode
|
||||||
/// [`cbor`]: https://docs.rs/cbor
|
/// [`cbor`]: https://docs.rs/cbor
|
||||||
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
||||||
pub struct XOnlyPublicKey(ffi::XOnlyPublicKey);
|
pub struct XOnlyPublicKey(ffi::XOnlyPublicKey);
|
||||||
impl_fast_comparisons!(XOnlyPublicKey);
|
impl_fast_comparisons!(XOnlyPublicKey);
|
||||||
|
|
||||||
|
@ -1156,6 +1160,10 @@ impl fmt::Display for XOnlyPublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for XOnlyPublicKey {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
|
||||||
|
}
|
||||||
|
|
||||||
impl str::FromStr for XOnlyPublicKey {
|
impl str::FromStr for XOnlyPublicKey {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<XOnlyPublicKey, Error> {
|
fn from_str(s: &str) -> Result<XOnlyPublicKey, Error> {
|
||||||
|
|
Loading…
Reference in New Issue