@@ -613,8 +613,9 @@ impl Verification for PaymentId {
613
613
}
614
614
615
615
impl PaymentId {
616
- #[rustfmt::skip]
617
- fn for_inbound_from_htlcs<I: Iterator<Item=(ChannelId, u64)>>(key: &[u8; 32], htlcs: I) -> PaymentId {
616
+ fn for_inbound_from_htlcs<I: Iterator<Item = (ChannelId, u64)>>(
617
+ key: &[u8; 32], htlcs: I,
618
+ ) -> PaymentId {
618
619
let mut prev_pair = None;
619
620
let mut hasher = HmacEngine::new(key);
620
621
for (channel_id, htlc_id) in htlcs {
@@ -784,8 +785,9 @@ impl HTLCSource {
784
785
785
786
/// Checks whether this HTLCSource could possibly match the given HTLC output in a commitment
786
787
/// transaction. Useful to ensure different datastructures match up.
787
- #[rustfmt::skip]
788
- pub(crate) fn possibly_matches_output(&self, htlc: &super::chan_utils::HTLCOutputInCommitment) -> bool {
788
+ pub(crate) fn possibly_matches_output(
789
+ &self, htlc: &super::chan_utils::HTLCOutputInCommitment,
790
+ ) -> bool {
789
791
if let HTLCSource::OutboundRoute { first_hop_htlc_msat, .. } = self {
790
792
*first_hop_htlc_msat == htlc.amount_msat
791
793
} else {
@@ -874,8 +876,10 @@ impl MsgHandleErrInternal {
874
876
Self { err, closes_channel: false, shutdown_finish: None }
875
877
}
876
878
#[inline]
877
- #[rustfmt::skip]
878
- fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
879
+ fn from_finish_shutdown(
880
+ err: String, channel_id: ChannelId, shutdown_res: ShutdownResult,
881
+ channel_update: Option<msgs::ChannelUpdate>,
882
+ ) -> Self {
879
883
let err_msg = msgs::ErrorMessage { channel_id, data: err.clone() };
880
884
let action = if shutdown_res.monitor_update.is_some() {
881
885
// We have a closing `ChannelMonitorUpdate`, which means the channel was funded and we
@@ -1674,8 +1678,19 @@ pub trait AChannelManager {
1674
1678
/// A type that may be dereferenced to [`Self::Logger`].
1675
1679
type L: Deref<Target = Self::Logger>;
1676
1680
/// Returns a reference to the actual [`ChannelManager`] object.
1677
- #[rustfmt::skip]
1678
- fn get_cm(&self) -> &ChannelManager<Self::M, Self::T, Self::ES, Self::NS, Self::SP, Self::F, Self::R, Self::MR, Self::L>;
1681
+ fn get_cm(
1682
+ &self,
1683
+ ) -> &ChannelManager<
1684
+ Self::M,
1685
+ Self::T,
1686
+ Self::ES,
1687
+ Self::NS,
1688
+ Self::SP,
1689
+ Self::F,
1690
+ Self::R,
1691
+ Self::MR,
1692
+ Self::L,
1693
+ >;
1679
1694
}
1680
1695
1681
1696
impl<
@@ -2817,8 +2832,9 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
2817
2832
/// This must always be called if the changes included a `ChannelMonitorUpdate`, as well as in
2818
2833
/// other cases where losing the changes on restart may result in a force-close or otherwise
2819
2834
/// isn't ideal.
2820
- #[rustfmt::skip]
2821
- fn notify_on_drop<C: AChannelManager>(cm: &'a C) -> PersistenceNotifierGuard<'a, impl FnMut() -> NotifyOption> {
2835
+ fn notify_on_drop<C: AChannelManager>(
2836
+ cm: &'a C,
2837
+ ) -> PersistenceNotifierGuard<'a, impl FnMut() -> NotifyOption> {
2822
2838
Self::optionally_notify(cm, || -> NotifyOption { NotifyOption::DoPersist })
2823
2839
}
2824
2840
@@ -2850,9 +2866,9 @@ impl<'a> PersistenceNotifierGuard<'a, fn() -> NotifyOption> {
2850
2866
/// Note that if any [`ChannelMonitorUpdate`]s are possibly generated,
2851
2867
/// [`ChannelManager::process_background_events`] MUST be called first (or
2852
2868
/// [`Self::optionally_notify`] used).
2853
- #[rustfmt::skip]
2854
- fn optionally_notify_skipping_background_events<F: Fn() -> NotifyOption, C: AChannelManager>
2855
- (cm: &'a C, persist_check: F ) -> PersistenceNotifierGuard<'a, F> {
2869
+ fn optionally_notify_skipping_background_events<F: Fn() -> NotifyOption, C: AChannelManager>(
2870
+ cm: &'a C, persist_check: F,
2871
+ ) -> PersistenceNotifierGuard<'a, F> {
2856
2872
let read_guard = cm.get_cm().total_consistency_lock.read().unwrap();
2857
2873
2858
2874
PersistenceNotifierGuard {
@@ -4100,8 +4116,9 @@ where
4100
4116
/// [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
4101
4117
/// [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
4102
4118
/// [`SendShutdown`]: MessageSendEvent::SendShutdown
4103
- #[rustfmt::skip]
4104
- pub fn close_channel(&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey) -> Result<(), APIError> {
4119
+ pub fn close_channel(
4120
+ &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey,
4121
+ ) -> Result<(), APIError> {
4105
4122
self.close_channel_internal(channel_id, counterparty_node_id, None, None)
4106
4123
}
4107
4124
@@ -4367,9 +4384,9 @@ where
4367
4384
///
4368
4385
/// Fails if `channel_id` is unknown to the manager, or if the `counterparty_node_id`
4369
4386
/// isn't the counterparty of the corresponding channel.
4370
- #[rustfmt::skip]
4371
- pub fn force_close_broadcasting_latest_txn( &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, error_message: String)
4372
- -> Result<(), APIError> {
4387
+ pub fn force_close_broadcasting_latest_txn(
4388
+ &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, error_message: String,
4389
+ ) -> Result<(), APIError> {
4373
4390
self.force_close_sending_error(channel_id, counterparty_node_id, true, error_message)
4374
4391
}
4375
4392
@@ -4383,9 +4400,9 @@ where
4383
4400
/// `counterparty_node_id` isn't the counterparty of the corresponding channel.
4384
4401
/// You can always broadcast the latest local transaction(s) via
4385
4402
/// [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
4386
- #[rustfmt::skip]
4387
- pub fn force_close_without_broadcasting_txn( &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, error_message: String)
4388
- -> Result<(), APIError> {
4403
+ pub fn force_close_without_broadcasting_txn(
4404
+ &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, error_message: String,
4405
+ ) -> Result<(), APIError> {
4389
4406
self.force_close_sending_error(channel_id, counterparty_node_id, false, error_message)
4390
4407
}
4391
4408
@@ -4987,8 +5004,9 @@ where
4987
5004
}
4988
5005
4989
5006
#[cfg(test)]
4990
- #[rustfmt::skip]
4991
- pub(crate) fn test_set_payment_metadata(&self, payment_id: PaymentId, new_payment_metadata: Option<Vec<u8>>) {
5007
+ pub(crate) fn test_set_payment_metadata(
5008
+ &self, payment_id: PaymentId, new_payment_metadata: Option<Vec<u8>>,
5009
+ ) {
4992
5010
self.pending_outbound_payments.test_set_payment_metadata(payment_id, new_payment_metadata);
4993
5011
}
4994
5012
@@ -5239,8 +5257,9 @@ where
5239
5257
/// Returns whether a payment with the given [`PaymentHash`] and [`PaymentId`] is, in fact, a
5240
5258
/// payment probe.
5241
5259
#[cfg(test)]
5242
- #[rustfmt::skip]
5243
- pub(crate) fn payment_is_probe(&self, payment_hash: &PaymentHash, payment_id: &PaymentId) -> bool {
5260
+ pub(crate) fn payment_is_probe(
5261
+ &self, payment_hash: &PaymentHash, payment_id: &PaymentId,
5262
+ ) -> bool {
5244
5263
outbound_payment::payment_is_probe(payment_hash, payment_id, self.probing_cookie_secret)
5245
5264
}
5246
5265
@@ -7432,9 +7451,11 @@ where
7432
7451
}
7433
7452
}
7434
7453
7435
- #[rustfmt::skip]
7436
7454
fn claim_funds_from_hop<
7437
- ComplFunc: FnOnce(Option<u64>, bool) -> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>)
7455
+ ComplFunc: FnOnce(
7456
+ Option<u64>,
7457
+ bool,
7458
+ ) -> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>),
7438
7459
>(
7439
7460
&self, prev_hop: HTLCPreviousHopData, payment_preimage: PaymentPreimage,
7440
7461
payment_info: Option<PaymentClaimDetails>, completion_action: ComplFunc,
@@ -8659,8 +8680,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8659
8680
}
8660
8681
}
8661
8682
8662
- #[rustfmt::skip]
8663
- fn internal_tx_add_input(&self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput) -> Result<(), MsgHandleErrInternal> {
8683
+ fn internal_tx_add_input(
8684
+ &self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput,
8685
+ ) -> Result<(), MsgHandleErrInternal> {
8664
8686
self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
8665
8687
match channel.as_unfunded_v2_mut() {
8666
8688
Some(unfunded_channel) => {
@@ -11795,8 +11817,10 @@ where
11795
11817
///
11796
11818
/// An [`EventHandler`] may safely call back to the provider in order to handle an event.
11797
11819
/// However, it must not call [`Writeable::write`] as doing so would result in a deadlock.
11798
- #[rustfmt::skip]
11799
- fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler {
11820
+ fn process_pending_events<H: Deref>(&self, handler: H)
11821
+ where
11822
+ H::Target: EventHandler,
11823
+ {
11800
11824
let mut ev;
11801
11825
process_events_body!(self, ev, handler.handle_event(ev));
11802
11826
}
@@ -12525,8 +12549,9 @@ where
12525
12549
});
12526
12550
}
12527
12551
12528
- #[rustfmt::skip]
12529
- fn handle_update_fail_malformed_htlc(&self, counterparty_node_id: PublicKey, msg: &msgs::UpdateFailMalformedHTLC) {
12552
+ fn handle_update_fail_malformed_htlc(
12553
+ &self, counterparty_node_id: PublicKey, msg: &msgs::UpdateFailMalformedHTLC,
12554
+ ) {
12530
12555
// Note that we never need to persist the updated ChannelManager for an inbound
12531
12556
// update_fail_malformed_htlc message - the message itself doesn't change our channel state
12532
12557
// only the `commitment_signed` message afterwards will.
@@ -12593,8 +12618,9 @@ where
12593
12618
});
12594
12619
}
12595
12620
12596
- #[rustfmt::skip]
12597
- fn handle_channel_reestablish(&self, counterparty_node_id: PublicKey, msg: &msgs::ChannelReestablish) {
12621
+ fn handle_channel_reestablish(
12622
+ &self, counterparty_node_id: PublicKey, msg: &msgs::ChannelReestablish,
12623
+ ) {
12598
12624
let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
12599
12625
let res = self.internal_channel_reestablish(&counterparty_node_id, msg);
12600
12626
let persist = match &res {
@@ -16204,8 +16230,9 @@ mod tests {
16204
16230
assert!(inbound_payment::verify(payment_hash, &payment_data, nodes[0].node.highest_seen_timestamp.load(Ordering::Acquire) as u64, &nodes[0].node.inbound_payment_key, &nodes[0].logger).is_ok());
16205
16231
}
16206
16232
16207
- #[rustfmt::skip]
16208
- fn check_not_connected_to_peer_error<T>(res_err: Result<T, APIError>, expected_public_key: PublicKey) {
16233
+ fn check_not_connected_to_peer_error<T>(
16234
+ res_err: Result<T, APIError>, expected_public_key: PublicKey,
16235
+ ) {
16209
16236
let expected_message = format!("Not connected to node: {}", expected_public_key);
16210
16237
check_api_error_message(expected_message, res_err)
16211
16238
}
0 commit comments