1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Fix clippy issues from 1.74 (#3558)

Nothing major
This commit is contained in:
Emil Ernerfeldt
2023-11-16 15:50:44 +01:00
committed by GitHub
parent a243180600
commit f01b2b76c8
8 changed files with 14 additions and 20 deletions

View File

@@ -35,19 +35,16 @@ impl<T: Float> PartialEq<Self> for OrderedFloat<T> {
impl<T: Float> PartialOrd<Self> for OrderedFloat<T> {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match self.0.partial_cmp(&other.0) {
Some(ord) => Some(ord),
None => Some(self.0.is_nan().cmp(&other.0.is_nan())),
}
Some(self.cmp(other))
}
}
impl<T: Float> Ord for OrderedFloat<T> {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
match self.partial_cmp(other) {
match self.0.partial_cmp(&other.0) {
Some(ord) => ord,
None => unreachable!(),
None => self.0.is_nan().cmp(&other.0.is_nan()),
}
}
}