Make FeeRate ops impls more terse
Remove all instances of `FeeRate as Add>::Output` and just use `Self::Output`. No logic change.
This commit is contained in:
parent
297f9b5867
commit
cd0fa2d1dc
|
@ -194,19 +194,19 @@ impl Add for FeeRate {
|
|||
impl Add<FeeRate> for &FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn add(self, other: FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
|
||||
fn add(self, other: FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
|
||||
}
|
||||
|
||||
impl Add<&FeeRate> for FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn add(self, other: &FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
|
||||
fn add(self, other: &FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
|
||||
}
|
||||
|
||||
impl<'a> Add<&'a FeeRate> for &FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn add(self, other: &'a FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 + other.0) }
|
||||
fn add(self, other: &'a FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
|
||||
}
|
||||
|
||||
impl Sub for FeeRate {
|
||||
|
@ -218,19 +218,19 @@ impl Sub for FeeRate {
|
|||
impl Sub<FeeRate> for &FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn sub(self, other: FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
|
||||
fn sub(self, other: FeeRate) -> Self::Output { FeeRate(self.0 - other.0) }
|
||||
}
|
||||
|
||||
impl Sub<&FeeRate> for FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn sub(self, other: &FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
|
||||
fn sub(self, other: &FeeRate) -> Self::Output { FeeRate(self.0 - other.0) }
|
||||
}
|
||||
|
||||
impl<'a> Sub<&'a FeeRate> for &FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
||||
fn sub(self, other: &'a FeeRate) -> <FeeRate as Add>::Output { FeeRate(self.0 - other.0) }
|
||||
fn sub(self, other: &'a FeeRate) -> Self::Output { FeeRate(self.0 - other.0) }
|
||||
}
|
||||
|
||||
/// Computes the ceiling so that the fee computation is conservative.
|
||||
|
|
Loading…
Reference in New Issue