Skip to content

Commit 7d0a9d6

Browse files
committed
Cargo fmt everything
1 parent 5dcd6c4 commit 7d0a9d6

40 files changed

+57537
-22149
lines changed

lightning/src/chain/chaininterface.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -187,25 +187,29 @@ pub const FEERATE_FLOOR_SATS_PER_KW: u32 = 253;
187187
///
188188
/// Note that this does *not* implement [`FeeEstimator`] to make it harder to accidentally mix the
189189
/// two.
190-
pub(crate) struct LowerBoundedFeeEstimator<F: Deref>(pub F) where F::Target: FeeEstimator;
191-
192-
impl<F: Deref> LowerBoundedFeeEstimator<F> where F::Target: FeeEstimator {
190+
pub(crate) struct LowerBoundedFeeEstimator<F: Deref>(pub F)
191+
where
192+
F::Target: FeeEstimator;
193+
194+
impl<F: Deref> LowerBoundedFeeEstimator<F>
195+
where
196+
F::Target: FeeEstimator,
197+
{
193198
/// Creates a new `LowerBoundedFeeEstimator` which wraps the provided fee_estimator
194199
pub fn new(fee_estimator: F) -> Self {
195200
LowerBoundedFeeEstimator(fee_estimator)
196201
}
197202

198203
pub fn bounded_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 {
199-
cmp::max(
200-
self.0.get_est_sat_per_1000_weight(confirmation_target),
201-
FEERATE_FLOOR_SATS_PER_KW,
202-
)
204+
cmp::max(self.0.get_est_sat_per_1000_weight(confirmation_target), FEERATE_FLOOR_SATS_PER_KW)
203205
}
204206
}
205207

206208
#[cfg(test)]
207209
mod tests {
208-
use super::{FEERATE_FLOOR_SATS_PER_KW, LowerBoundedFeeEstimator, ConfirmationTarget, FeeEstimator};
210+
use super::{
211+
ConfirmationTarget, FeeEstimator, LowerBoundedFeeEstimator, FEERATE_FLOOR_SATS_PER_KW,
212+
};
209213

210214
struct TestFeeEstimator {
211215
sat_per_kw: u32,
@@ -223,7 +227,10 @@ mod tests {
223227
let test_fee_estimator = &TestFeeEstimator { sat_per_kw };
224228
let fee_estimator = LowerBoundedFeeEstimator::new(test_fee_estimator);
225229

226-
assert_eq!(fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee), FEERATE_FLOOR_SATS_PER_KW);
230+
assert_eq!(
231+
fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee),
232+
FEERATE_FLOOR_SATS_PER_KW
233+
);
227234
}
228235

229236
#[test]
@@ -232,6 +239,9 @@ mod tests {
232239
let test_fee_estimator = &TestFeeEstimator { sat_per_kw };
233240
let fee_estimator = LowerBoundedFeeEstimator::new(test_fee_estimator);
234241

235-
assert_eq!(fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee), sat_per_kw);
242+
assert_eq!(
243+
fee_estimator.bounded_sat_per_1000_weight(ConfirmationTarget::AnchorChannelFee),
244+
sat_per_kw
245+
);
236246
}
237247
}

0 commit comments

Comments
 (0)