refactor(identity): fix clippy beta lint

From the lint documentation:

> If both `PartialOrd` and `Ord` are implemented, they must agree. This is commonly done by wrapping the result of `cmp` in `Some` for `partial_cmp`. Not doing this may silently introduce an error upon refactoring.

Pull-Request: #4379.
This commit is contained in:
Thomas Eizinger 2023-08-24 08:01:19 +02:00 committed by GitHub
parent 54fa53af39
commit 3bce9ebddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ impl hash::Hash for PublicKey {
impl cmp::PartialOrd for PublicKey { impl cmp::PartialOrd for PublicKey {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
self.0.as_bytes().partial_cmp(other.0.as_bytes()) Some(self.cmp(other))
} }
} }

View File

@ -178,7 +178,7 @@ impl hash::Hash for PublicKey {
impl cmp::PartialOrd for PublicKey { impl cmp::PartialOrd for PublicKey {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> { fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
self.to_bytes().partial_cmp(&other.to_bytes()) Some(self.cmp(other))
} }
} }