Skip to content

Commit f6b9d9b

Browse files
authored
Generalise lifetimes for binop implementations (#181)
* Generalise lifetimes for binop implementations
1 parent 25da208 commit f6b9d9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 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,11 +1555,11 @@ 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]
1562-
fn $method(self, other: Self) -> Self::Output {
1562+
fn $method(self, other: &NotNan<T>) -> Self::Output {
15631563
(*self).$method(*other)
15641564
}
15651565
}

0 commit comments

Comments
 (0)