mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-15 04:11:19 +00:00
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:
parent
54fa53af39
commit
3bce9ebddf
@ -128,7 +128,7 @@ impl hash::Hash for PublicKey {
|
||||
|
||||
impl cmp::PartialOrd for PublicKey {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||
self.0.as_bytes().partial_cmp(other.0.as_bytes())
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ impl hash::Hash for PublicKey {
|
||||
|
||||
impl cmp::PartialOrd for PublicKey {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||
self.to_bytes().partial_cmp(&other.to_bytes())
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user