Skip to content

Commit cf0c48c

Browse files
committed
Improve Debug for PrivateKey
1 parent b65a6ae commit cf0c48c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/util/ecdsa.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ impl FromStr for PublicKey {
173173

174174
/// A Bitcoin ECDSA private key
175175
#[derive(Copy, Clone, PartialEq, Eq)]
176+
#[cfg_attr(feature = "std", derive(Debug))]
176177
pub struct PrivateKey {
177178
/// Whether this private key should be serialized as compressed
178179
pub compressed: bool,
@@ -279,6 +280,7 @@ impl fmt::Display for PrivateKey {
279280
}
280281
}
281282

283+
#[cfg(not(feature = "std"))]
282284
impl fmt::Debug for PrivateKey {
283285
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
284286
write!(f, "[private key data]")

0 commit comments

Comments
 (0)