Skip to content

Commit ca32f7b

Browse files
committedSep 17, 2024·
improved PublicKey debug impl
1 parent 2a80731 commit ca32f7b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎src/key.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl str::FromStr for SecretKey {
144144
/// ```
145145
/// [`bincode`]: https://docs.rs/bincode
146146
/// [`cbor`]: https://docs.rs/cbor
147-
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
147+
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
148148
#[repr(transparent)]
149149
pub struct PublicKey(ffi::PublicKey);
150150
impl_fast_comparisons!(PublicKey);
@@ -163,6 +163,10 @@ impl fmt::Display for PublicKey {
163163
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
164164
}
165165

166+
impl fmt::Debug for PublicKey {
167+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
168+
}
169+
166170
impl str::FromStr for PublicKey {
167171
type Err = Error;
168172
fn from_str(s: &str) -> Result<PublicKey, Error> {
@@ -1138,7 +1142,7 @@ impl CPtr for Keypair {
11381142
/// ```
11391143
/// [`bincode`]: https://docs.rs/bincode
11401144
/// [`cbor`]: https://docs.rs/cbor
1141-
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
1145+
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
11421146
pub struct XOnlyPublicKey(ffi::XOnlyPublicKey);
11431147
impl_fast_comparisons!(XOnlyPublicKey);
11441148

@@ -1156,6 +1160,10 @@ impl fmt::Display for XOnlyPublicKey {
11561160
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
11571161
}
11581162

1163+
impl fmt::Debug for XOnlyPublicKey {
1164+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
1165+
}
1166+
11591167
impl str::FromStr for XOnlyPublicKey {
11601168
type Err = Error;
11611169
fn from_str(s: &str) -> Result<XOnlyPublicKey, Error> {

0 commit comments

Comments
 (0)
Please sign in to comment.