From af20a328a4afcc4e0f40b4f4db804ad00acf2d53 Mon Sep 17 00:00:00 2001 From: Youyuan Wu Date: Mon, 21 Oct 2024 15:49:46 -0700 Subject: [PATCH] fix clippy --- crates/libs/core/src/client/notification.rs | 10 +--------- crates/libs/core/src/client/svc_mgmt_client.rs | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/crates/libs/core/src/client/notification.rs b/crates/libs/core/src/client/notification.rs index 4ddd0bac..72c35445 100644 --- a/crates/libs/core/src/client/notification.rs +++ b/crates/libs/core/src/client/notification.rs @@ -127,15 +127,7 @@ impl PartialOrd for ServiceEndpointsVersion { /// a is newer and up to date. fn partial_cmp(&self, other: &Self) -> Option { match self.compare(other) { - Ok(i) => { - if i == 0 { - Some(std::cmp::Ordering::Equal) - } else if i > 0 { - Some(std::cmp::Ordering::Greater) - } else { - Some(std::cmp::Ordering::Less) - } - } + Ok(i) => Some(i.cmp(&0)), // If you compare version of different service you get error Err(_) => None, } diff --git a/crates/libs/core/src/client/svc_mgmt_client.rs b/crates/libs/core/src/client/svc_mgmt_client.rs index 75ed849d..3519c28f 100644 --- a/crates/libs/core/src/client/svc_mgmt_client.rs +++ b/crates/libs/core/src/client/svc_mgmt_client.rs @@ -420,15 +420,7 @@ impl PartialOrd for ResolvedServicePartition { /// a is newer and up to date. fn partial_cmp(&self, other: &Self) -> Option { match self.compare_version(other) { - Ok(i) => { - if i == 0 { - Some(std::cmp::Ordering::Equal) - } else if i > 0 { - Some(std::cmp::Ordering::Greater) - } else { - Some(std::cmp::Ordering::Less) - } - } + Ok(i) => Some(i.cmp(&0)), // If you compare version of different service you get error Err(_) => None, }