Fix bad partial ord implementation

This commit is contained in:
Zhang Junyang
2023-08-02 13:33:17 +08:00
committed by Tate, Hongliang Tian
parent 8fc4fa6f10
commit 48ae6611f6
2 changed files with 19 additions and 18 deletions

View File

@ -71,19 +71,20 @@ impl PartialEq for ComponentInfo {
}
}
impl PartialOrd for ComponentInfo {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
self.priority.partial_cmp(&other.priority)
}
}
impl Eq for ComponentInfo {}
impl Ord for ComponentInfo {
fn cmp(&self, other: &Self) -> core::cmp::Ordering {
self.priority.cmp(&other.priority)
}
}
impl PartialOrd for ComponentInfo {
fn partial_cmp(&self, other: &ComponentInfo) -> Option<core::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Debug for ComponentInfo {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("ComponentInfo")