Skip to content

Commit 2f7cea4

Browse files
committed
Update Ord::min and Ord::max to match
1 parent d409475 commit 2f7cea4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

library/core/src/cmp.rs

+19
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,25 @@ mod impls {
14821482
// SAFETY: The discriminants of Ord were chosen to permit this
14831483
unsafe { crate::mem::transmute(res) }
14841484
}
1485+
1486+
#[inline]
1487+
fn max(self, other: Self) -> Self {
1488+
if self > other {
1489+
self
1490+
} else {
1491+
other
1492+
}
1493+
}
1494+
1495+
#[inline]
1496+
fn min(self, other: Self) -> Self {
1497+
if self > other {
1498+
other
1499+
} else {
1500+
self
1501+
}
1502+
}
1503+
14851504
}
14861505
)*)
14871506
}

0 commit comments

Comments
 (0)