units: Use rhs instead of other

Be uniform and use `rhs` for all identifiers in the ops impls.

Refactor only, no logic changes.
This commit is contained in:
Tobin C. Harding 2024-12-11 15:39:22 +11:00
parent cd0fa2d1dc
commit b31ca72b33
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
3 changed files with 10 additions and 10 deletions

View File

@ -390,7 +390,7 @@ impl ops::Add for SignedAmount {
}
impl ops::AddAssign for SignedAmount {
fn add_assign(&mut self, other: SignedAmount) { *self = *self + other }
fn add_assign(&mut self, rhs: SignedAmount) { *self = *self + rhs }
}
impl ops::Sub for SignedAmount {
@ -402,7 +402,7 @@ impl ops::Sub for SignedAmount {
}
impl ops::SubAssign for SignedAmount {
fn sub_assign(&mut self, other: SignedAmount) { *self = *self - other }
fn sub_assign(&mut self, rhs: SignedAmount) { *self = *self - rhs }
}
impl ops::Rem<i64> for SignedAmount {

View File

@ -459,7 +459,7 @@ impl ops::Add for Amount {
}
impl ops::AddAssign for Amount {
fn add_assign(&mut self, other: Amount) { *self = *self + other }
fn add_assign(&mut self, rhs: Amount) { *self = *self + rhs }
}
impl ops::Sub for Amount {
@ -471,7 +471,7 @@ impl ops::Sub for Amount {
}
impl ops::SubAssign for Amount {
fn sub_assign(&mut self, other: Amount) { *self = *self - other }
fn sub_assign(&mut self, rhs: Amount) { *self = *self - rhs }
}
impl ops::Rem<u64> for Amount {

View File

@ -194,19 +194,19 @@ impl Add for FeeRate {
impl Add<FeeRate> for &FeeRate {
type Output = FeeRate;
fn add(self, other: FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
fn add(self, rhs: FeeRate) -> Self::Output { FeeRate(self.0 + rhs.0) }
}
impl Add<&FeeRate> for FeeRate {
type Output = FeeRate;
fn add(self, other: &FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
fn add(self, rhs: &FeeRate) -> Self::Output { FeeRate(self.0 + rhs.0) }
}
impl<'a> Add<&'a FeeRate> for &FeeRate {
type Output = FeeRate;
fn add(self, other: &'a FeeRate) -> Self::Output { FeeRate(self.0 + other.0) }
fn add(self, rhs: &'a FeeRate) -> Self::Output { FeeRate(self.0 + rhs.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) -> Self::Output { FeeRate(self.0 - other.0) }
fn sub(self, rhs: FeeRate) -> Self::Output { FeeRate(self.0 - rhs.0) }
}
impl Sub<&FeeRate> for FeeRate {
type Output = FeeRate;
fn sub(self, other: &FeeRate) -> Self::Output { FeeRate(self.0 - other.0) }
fn sub(self, rhs: &FeeRate) -> Self::Output { FeeRate(self.0 - rhs.0) }
}
impl<'a> Sub<&'a FeeRate> for &FeeRate {
type Output = FeeRate;
fn sub(self, other: &'a FeeRate) -> Self::Output { FeeRate(self.0 - other.0) }
fn sub(self, rhs: &'a FeeRate) -> Self::Output { FeeRate(self.0 - rhs.0) }
}
/// Computes the ceiling so that the fee computation is conservative.