Improve Debug for PrivateKey

This commit is contained in:
Dr Maxim Orlovsky 2022-01-08 20:46:52 +01:00
parent b65a6ae49b
commit cf0c48cc86
1 changed files with 2 additions and 0 deletions

View File

@ -173,6 +173,7 @@ impl FromStr for PublicKey {
/// A Bitcoin ECDSA private key
#[derive(Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct PrivateKey {
/// Whether this private key should be serialized as compressed
pub compressed: bool,
@ -279,6 +280,7 @@ impl fmt::Display for PrivateKey {
}
}
#[cfg(not(feature = "std"))]
impl fmt::Debug for PrivateKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[private key data]")