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:
Tobin C. Harding 2024-12-11 15:37:21 +11:00
parent 297f9b5867
commit cd0fa2d1dc
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 6 additions and 6 deletions

View File

@ -194,19 +194,19 @@ impl Add for FeeRate {
impl Add<FeeRate> for &FeeRate { impl Add<FeeRate> for &FeeRate {
type Output = 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 { impl Add<&FeeRate> for FeeRate {
type Output = 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 { impl<'a> Add<&'a FeeRate> for &FeeRate {
type Output = 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 { impl Sub for FeeRate {
@ -218,19 +218,19 @@ impl Sub for FeeRate {
impl Sub<FeeRate> for &FeeRate { impl Sub<FeeRate> for &FeeRate {
type Output = 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 { impl Sub<&FeeRate> for FeeRate {
type Output = 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 { impl<'a> Sub<&'a FeeRate> for &FeeRate {
type Output = 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. /// Computes the ceiling so that the fee computation is conservative.