Skip to content

Commit 75f837d

Browse files
authored
Generalise lifetimes for binop implementations
1 parent 25da208 commit 75f837d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ macro_rules! impl_ordered_float_binop {
429429
}
430430

431431
// Work around for: https://github.com/reem/rust-ordered-float/issues/91
432-
impl<'a, T: $imp + Copy> $imp<Self> for &'a OrderedFloat<T> {
432+
impl<'a, 'b, T: $imp + Copy> $imp<&'b OrderedFloat<T>> for &'a OrderedFloat<T> {
433433
type Output = OrderedFloat<T::Output>;
434434

435435
#[inline]
436-
fn $method(self, other: Self) -> Self::Output {
436+
fn $method(self, other: &'b OrderedFloat<T>) -> Self::Output {
437437
OrderedFloat((self.0).$method(other.0))
438438
}
439439
}
@@ -1555,7 +1555,7 @@ macro_rules! impl_not_nan_binop {
15551555
}
15561556
}
15571557

1558-
impl<T: FloatCore> $imp for &NotNan<T> {
1558+
impl<T: FloatCore> $imp<&NotNan<T>> for &NotNan<T> {
15591559
type Output = NotNan<T>;
15601560

15611561
#[inline]

0 commit comments

Comments
 (0)