Implement PartialOrd/Ord for dpi module types
This commit is contained in:
parent
a7986b077f
commit
3c3be71a77
3 changed files with 7 additions and 9 deletions
|
|
@ -32,12 +32,9 @@ impl PartialOrd for VideoMode {
|
|||
|
||||
impl Ord for VideoMode {
|
||||
fn cmp(&self, other: &VideoMode) -> std::cmp::Ordering {
|
||||
// TODO: we can impl `Ord` for `PhysicalSize` once we switch from `f32`
|
||||
// to `u32` there
|
||||
let size: (u32, u32) = self.size().into();
|
||||
let other_size: (u32, u32) = other.size().into();
|
||||
self.monitor().cmp(&other.monitor()).then(
|
||||
size.cmp(&other_size)
|
||||
self.size()
|
||||
.cmp(&other.size())
|
||||
.then(
|
||||
self.refresh_rate_millihertz()
|
||||
.cmp(&other.refresh_rate_millihertz())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue