rust-vmm / vm-fdt

Apache License 2.0
14 stars 16 forks source link

fix(writer): `clippy::incorrect_partial_ord_impl_on_ord_type` #69

Closed mkroening closed 1 year ago

mkroening commented 1 year ago

Summary of the PR

$ cargo clippy
    Checking vm-fdt v0.2.0 (/Users/mkroening/devel/vm-fdt)
error: incorrect implementation of `partial_cmp` on an `Ord` type
   --> src/writer.rs:137:1
    |
137 | /  impl PartialOrd for FdtReserveEntry {
138 | |      fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
    | | _____________________________________________________________-
139 | ||         self.address.partial_cmp(&other.address)
140 | ||     }
    | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
141 | |  }
    | |__^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
    = note: `#[deny(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default

error: could not compile `vm-fdt` (lib) due to previous error

Requirements

Before submitting your PR, please make sure you addressed the following requirements: