Skip to content

Commit cf94d71

Browse files
Fmt Botgithub-actions[bot]
authored andcommitted
2025-05-11 automated rustfmt nightly
1 parent 41f26cf commit cf94d71

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

units/src/fee.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
use core::ops;
1515

1616
use NumOpResult as R;
17-
use crate::NumOpError as E;
1817

19-
use crate::{Amount, FeeRate, MathOp, NumOpResult, OptionExt, Weight};
18+
use crate::{Amount, FeeRate, MathOp, NumOpError as E, NumOpResult, OptionExt, Weight};
2019

2120
impl Amount {
2221
/// Checked weight ceiling division.
@@ -119,7 +118,9 @@ impl FeeRate {
119118
/// [`NumOpResult::Error`] if an overflow occurred.
120119
///
121120
/// This is equivalent to `Self::checked_mul_by_weight()`.
122-
pub fn to_fee(self, weight: Weight) -> NumOpResult<Amount> { self.checked_mul_by_weight(weight) }
121+
pub fn to_fee(self, weight: Weight) -> NumOpResult<Amount> {
122+
self.checked_mul_by_weight(weight)
123+
}
123124

124125
/// Calculates the fee by multiplying this fee rate by weight, in weight units, returning [`None`]
125126
/// if an overflow occurred.
@@ -150,7 +151,7 @@ impl FeeRate {
150151
///
151152
/// Returns [`NumOpResult::Error`] if overflow occurred.
152153
pub const fn checked_mul_by_weight(self, weight: Weight) -> NumOpResult<Amount> {
153-
if let Some(fee) = self.to_sat_per_kwu().checked_mul(weight.to_wu()) {
154+
if let Some(fee) = self.to_sat_per_kwu().checked_mul(weight.to_wu()) {
154155
if let Some(round_up) = fee.checked_add(999) {
155156
if let Ok(ret) = Amount::from_sat(round_up / 1_000) {
156157
return NumOpResult::Valid(ret);

0 commit comments

Comments
 (0)