Use cmp of Self in implementaions of partial_cmp (#8559)

# Objective

Ensure future consistency between the two compare functions for all
types with manual `Ord` and `PartialOrd` implementations.

## Solution

Use `Self::cpm` in the implementation of `partial_cpm` for types
`Handle` and `Name`.
This commit is contained in:
konsti219 2023-05-07 00:31:25 +02:00 committed by GitHub
parent d319910d36
commit 1530f63756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -279,7 +279,7 @@ impl<T: Asset> Eq for Handle<T> {}
impl<T: Asset> PartialOrd for Handle<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.id.cmp(&other.id))
Some(self.cmp(other))
}
}

View file

@ -177,7 +177,7 @@ impl Eq for Name {}
impl PartialOrd for Name {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.name.partial_cmp(&other.name)
Some(self.cmp(other))
}
}