mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
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<Ordering> { | | _________________________________________________________________- 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 <rbradford@rivosinc.com>
This commit is contained in:
parent
239f422203
commit
cc4422d58b
@ -85,7 +85,7 @@ impl Ord for BusRange {
|
||||
|
||||
impl PartialOrd for BusRange {
|
||||
fn partial_cmp(&self, other: &BusRange) -> Option<Ordering> {
|
||||
self.base.partial_cmp(&other.base)
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user