diff --git a/identity/src/ed25519.rs b/identity/src/ed25519.rs index 23d11932..06708ce6 100644 --- a/identity/src/ed25519.rs +++ b/identity/src/ed25519.rs @@ -128,7 +128,7 @@ impl hash::Hash for PublicKey { impl cmp::PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { - self.0.as_bytes().partial_cmp(other.0.as_bytes()) + Some(self.cmp(other)) } } diff --git a/identity/src/secp256k1.rs b/identity/src/secp256k1.rs index a32a64e7..94b9b917 100644 --- a/identity/src/secp256k1.rs +++ b/identity/src/secp256k1.rs @@ -178,7 +178,7 @@ impl hash::Hash for PublicKey { impl cmp::PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { - self.to_bytes().partial_cmp(&other.to_bytes()) + Some(self.cmp(other)) } }