Skip to content

Commit 55429b3

Browse files
committed
Take reference for Real::min/max
1 parent db84b2a commit 55429b3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/real/arithmetic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,8 @@ impl Real {
11611161
/// If refinement cannot decide the order at the standard partial-order
11621162
/// precision, this keeps `self`, matching the conservative behavior of
11631163
/// [`PartialOrd`] callers that treat incomparability as no improvement.
1164-
pub fn min(self, other: Real) -> Real {
1165-
match self.partial_cmp(&other) {
1164+
pub fn min<'r>(&'r self, other: &'r Real) -> &'r Real {
1165+
match self.partial_cmp(other) {
11661166
Some(Ordering::Greater) => other,
11671167
_ => self,
11681168
}
@@ -1173,8 +1173,8 @@ impl Real {
11731173
/// If refinement cannot decide the order at the standard partial-order
11741174
/// precision, this keeps `self`, matching the conservative behavior of
11751175
/// [`PartialOrd`] callers that treat incomparability as no improvement.
1176-
pub fn max(self, other: Real) -> Real {
1177-
match self.partial_cmp(&other) {
1176+
pub fn max<'r>(&'r self, other: &'r Real) -> &'r Real {
1177+
match self.partial_cmp(other) {
11781178
Some(Ordering::Less) => other,
11791179
_ => self,
11801180
}

0 commit comments

Comments
 (0)