mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-14 11:15:53 +00:00
Make PartialOrd
implementations match Ord
Clippy starts detecting this in Rust 1.73.0.
This commit is contained in:
parent
70fcd95577
commit
45b6bb4e7c
@ -158,7 +158,7 @@ impl<T: CurveBoundaryElement> Ord for CurveBoundary<T> {
|
|||||||
|
|
||||||
impl<T: CurveBoundaryElement> PartialOrd for CurveBoundary<T> {
|
impl<T: CurveBoundaryElement> PartialOrd for CurveBoundary<T> {
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||||
self.inner.partial_cmp(&other.inner)
|
Some(self.cmp(other))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ impl<T> Ord for HandleWrapper<T> {
|
|||||||
|
|
||||||
impl<T> PartialOrd for HandleWrapper<T> {
|
impl<T> PartialOrd for HandleWrapper<T> {
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||||
self.0.id().partial_cmp(&other.0.id())
|
Some(self.cmp(other))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ impl Eq for Scalar {}
|
|||||||
|
|
||||||
impl PartialOrd for Scalar {
|
impl PartialOrd for Scalar {
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||||
self.0.partial_cmp(&other.0)
|
Some(self.cmp(other))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ impl Ord for Scalar {
|
|||||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||||
// Should never panic, as `from_f64` checks that the wrapped value is
|
// Should never panic, as `from_f64` checks that the wrapped value is
|
||||||
// finite.
|
// finite.
|
||||||
self.partial_cmp(other).expect("Invalid `Scalar`")
|
self.0.partial_cmp(&other.0).expect("Invalid `Scalar`")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user