From da19a5f122f51da83f344e3cf9857df3c5ebe5da Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Tue, 17 Oct 2023 07:20:26 +0200 Subject: [PATCH] fix: make clippy happy about PartialOrd impls (#96) --- src/server/actix_server/hpo_omims.rs | 6 +----- src/server/actix_server/hpo_terms.rs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/server/actix_server/hpo_omims.rs b/src/server/actix_server/hpo_omims.rs index e08bbd4..f3e3983 100644 --- a/src/server/actix_server/hpo_omims.rs +++ b/src/server/actix_server/hpo_omims.rs @@ -77,11 +77,7 @@ impl Eq for ResultEntry {} impl PartialOrd for ResultEntry { fn partial_cmp(&self, other: &Self) -> Option { - match self.omim_id.partial_cmp(&other.omim_id) { - Some(core::cmp::Ordering::Equal) => {} - ord => return ord, - } - self.name.partial_cmp(&other.name) + Some(self.cmp(other)) } } diff --git a/src/server/actix_server/hpo_terms.rs b/src/server/actix_server/hpo_terms.rs index 77f5ee9..bd9eb96 100644 --- a/src/server/actix_server/hpo_terms.rs +++ b/src/server/actix_server/hpo_terms.rs @@ -75,11 +75,7 @@ impl Eq for ResultEntry {} impl PartialOrd for ResultEntry { fn partial_cmp(&self, other: &Self) -> Option { - match self.term_id.partial_cmp(&other.term_id) { - Some(core::cmp::Ordering::Equal) => {} - ord => return ord, - } - self.name.partial_cmp(&other.name) + Some(self.cmp(other)) } }