Skip to content

Commit 5837c72

Browse files
committed
Correct reimplementation of order traits
Following the clippy rule 'incorrect_partial_ord_impl_on_ord_type'. Previous fix proposed by clippy was incorrect.
1 parent 28d4b1b commit 5837c72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mithril-common/src/database/version_checker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ impl SqlMigration {
154154

155155
impl PartialOrd for SqlMigration {
156156
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
157-
Some(self.version.cmp(&other.version))
157+
Some(self.cmp(other))
158158
}
159159
}
160160

161161
impl Ord for SqlMigration {
162162
fn cmp(&self, other: &Self) -> Ordering {
163-
self.partial_cmp(other).unwrap()
163+
self.version.cmp(&other.version)
164164
}
165165
}
166166

mithril-common/src/entities/signer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl PartialEq for SignerWithStake {
152152

153153
impl PartialOrd for SignerWithStake {
154154
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
155-
Some(self.party_id.cmp(&other.party_id))
155+
Some(self.cmp(other))
156156
}
157157
}
158158

0 commit comments

Comments
 (0)