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:
parent
cd0fa2d1dc
commit
b31ca72b33
|
@ -390,7 +390,7 @@ impl ops::Add for SignedAmount {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::AddAssign 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 {
|
impl ops::Sub for SignedAmount {
|
||||||
|
@ -402,7 +402,7 @@ impl ops::Sub for SignedAmount {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::SubAssign 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 {
|
impl ops::Rem<i64> for SignedAmount {
|
||||||
|
|
|
@ -459,7 +459,7 @@ impl ops::Add for Amount {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::AddAssign 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 {
|
impl ops::Sub for Amount {
|
||||||
|
@ -471,7 +471,7 @@ impl ops::Sub for Amount {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::SubAssign 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 {
|
impl ops::Rem<u64> for Amount {
|
||||||
|
|
|
@ -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) -> Self::Output { FeeRate(self.0 + other.0) }
|
fn add(self, rhs: FeeRate) -> Self::Output { FeeRate(self.0 + rhs.0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Add<&FeeRate> for FeeRate {
|
impl Add<&FeeRate> for FeeRate {
|
||||||
type Output = 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 {
|
impl<'a> Add<&'a FeeRate> for &FeeRate {
|
||||||
type Output = 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 {
|
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) -> Self::Output { FeeRate(self.0 - other.0) }
|
fn sub(self, rhs: FeeRate) -> Self::Output { FeeRate(self.0 - rhs.0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Sub<&FeeRate> for FeeRate {
|
impl Sub<&FeeRate> for FeeRate {
|
||||||
type Output = 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 {
|
impl<'a> Sub<&'a FeeRate> for &FeeRate {
|
||||||
type Output = 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.
|
/// Computes the ceiling so that the fee computation is conservative.
|
||||||
|
|
Loading…
Reference in New Issue