Skip to content

Commit 3acdb33

Browse files
committed
Make PartialOrd impl more idiomatic
Fixes nightly clippy `non_canonical_partial_ord_impl` lint.
1 parent b28c40a commit 3acdb33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl SslSession {
394394

395395
impl PartialOrd<Self> for SslSession {
396396
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
397-
Some(self.id.cmp(&other.id))
397+
Some(self.cmp(other))
398398
}
399399
}
400400

src/not_thread_safe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<T: Ord + PartialOrd> Ord for NotThreadSafe<T> {
5050

5151
impl<T: PartialOrd<T> + Ord> PartialOrd for NotThreadSafe<T> {
5252
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
53-
Some(self.get().cmp(other.get()))
53+
Some(self.cmp(other))
5454
}
5555
}
5656

0 commit comments

Comments
 (0)