From cc4422d58b21f53f7f54d8b8709d574587be2507 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 22 Aug 2023 10:46:58 +0100 Subject: [PATCH] vm-device: bus: Fix incorrect partial_cmp implementation warning: incorrect implementation of `partial_cmp` on an `Ord` type --> vm-device/src/bus.rs:86:1 | 86 | / impl PartialOrd for BusRange { 87 | | fn partial_cmp(&self, other: &BusRange) -> Option { | | _________________________________________________________________- 88 | || self.base.partial_cmp(&other.base) 89 | || } | ||_____- help: change this to: `{ Some(self.cmp(other)) }` 90 | | } | |__^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type = note: `#[warn(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default Signed-off-by: Rob Bradford --- vm-device/src/bus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm-device/src/bus.rs b/vm-device/src/bus.rs index bf377154d..c7f415cec 100644 --- a/vm-device/src/bus.rs +++ b/vm-device/src/bus.rs @@ -85,7 +85,7 @@ impl Ord for BusRange { impl PartialOrd for BusRange { fn partial_cmp(&self, other: &BusRange) -> Option { - self.base.partial_cmp(&other.base) + Some(self.cmp(other)) } }