diff --git a/ecdsa/src/lib.rs b/ecdsa/src/lib.rs index 6304363b..96f1a16e 100644 --- a/ecdsa/src/lib.rs +++ b/ecdsa/src/lib.rs @@ -83,10 +83,7 @@ pub use crate::signing::SigningKey; #[cfg(feature = "verifying")] pub use crate::verifying::VerifyingKey; -use core::{ - fmt::{self, Debug}, - ops::Add, -}; +use core::{fmt, ops::Add}; use elliptic_curve::{ generic_array::{sequence::Concat, typenum::Unsigned, ArrayLength, GenericArray}, FieldBytes, FieldBytesSize, ScalarPrimitive, @@ -321,22 +318,6 @@ where { } -impl Debug for Signature -where - C: PrimeCurve, - SignatureSize: ArrayLength, -{ - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "ecdsa::Signature<{:?}>(", C::default())?; - - for byte in self.to_bytes() { - write!(f, "{:02X}", byte)?; - } - - write!(f, ")") - } -} - impl From> for SignatureBytes where C: PrimeCurve, @@ -367,6 +348,22 @@ where } } +impl fmt::Debug for Signature +where + C: PrimeCurve, + SignatureSize: ArrayLength, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "ecdsa::Signature<{:?}>(", C::default())?; + + for byte in self.to_bytes() { + write!(f, "{:02X}", byte)?; + } + + write!(f, ")") + } +} + impl fmt::Display for Signature where C: PrimeCurve,