Partially revert 5b08c9f397
This commit is contained in:
parent
d02cab1e18
commit
de08218f24
1 changed files with 8 additions and 2 deletions
|
|
@ -800,7 +800,10 @@ pub trait Ord: Eq + PartialOrd<Self> {
|
|||
Self: Sized,
|
||||
Self: ~const Destruct,
|
||||
{
|
||||
max_by(self, other, Ord::cmp)
|
||||
match self.cmp(&other) {
|
||||
Ordering::Less | Ordering::Equal => other,
|
||||
Ordering::Greater => self,
|
||||
}
|
||||
}
|
||||
|
||||
/// Compares and returns the minimum of two values.
|
||||
|
|
@ -821,7 +824,10 @@ pub trait Ord: Eq + PartialOrd<Self> {
|
|||
Self: Sized,
|
||||
Self: ~const Destruct,
|
||||
{
|
||||
min_by(self, other, Ord::cmp)
|
||||
match self.cmp(&other) {
|
||||
Ordering::Less | Ordering::Equal => self,
|
||||
Ordering::Greater => other,
|
||||
}
|
||||
}
|
||||
|
||||
/// Restrict a value to a certain interval.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue