Skip to content

Commit 8a9419a

Browse files
committed
Run rustfmt on ln/mod.rs/re-enable it on the ln module
In d257b8a we dropped our old `rustfmt` per-file exclusion logic and replaced it with `rustfmt_skip` tags in each previously-skipped files. This had the unintended consequence of fully disabling `rustfmt` across the `lightning` crate: `rustfmt` operates recursively across files in any module it is told to format. Previously, because we were running `rustfmt` on each non-excluded file, this meant we wanted to exclude `mod.rs` and `lib.rs` files - not doing so would result in the entire module/crate being formatted. However, `cargo fmt --check` only runs `rustfmt` once - on `lib.rs`. Because we added a top-level `rustfmt_skip` in `lib.rs` this caused `rustfmt` to ignore it and all modules. Here we prepare to fix this by formatting `lightning/src/ln/mod.rs`.
1 parent 49fbb5b commit 8a9419a

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

lightning/src/ln/mod.rs

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
31
// This file is Copyright its original authors, visible in version control
42
// history.
53
//
@@ -15,15 +13,15 @@
1513
#[macro_use]
1614
pub mod functional_test_utils;
1715

18-
pub mod onion_payment;
19-
pub mod channelmanager;
16+
pub mod chan_utils;
2017
pub mod channel_keys;
2118
pub mod channel_state;
19+
pub mod channelmanager;
20+
mod features;
2221
pub mod inbound_payment;
2322
pub mod msgs;
23+
pub mod onion_payment;
2424
pub mod peer_handler;
25-
pub mod chan_utils;
26-
mod features;
2725
pub mod script;
2826
pub mod types;
2927

@@ -59,64 +57,64 @@ pub use onion_utils::process_onion_failure;
5957
#[cfg(fuzzing)]
6058
pub use onion_utils::AttributionData;
6159

60+
#[cfg(all(test, async_payments))]
61+
#[allow(unused_mut)]
62+
mod async_payments_tests;
6263
#[cfg(test)]
6364
#[allow(unused_mut)]
64-
pub mod bolt11_payment_tests;
65+
mod async_signer_tests;
6566
#[cfg(test)]
6667
#[allow(unused_mut)]
6768
mod blinded_payment_tests;
68-
#[cfg(all(test, async_payments))]
69+
#[cfg(test)]
6970
#[allow(unused_mut)]
70-
mod async_payments_tests;
71+
pub mod bolt11_payment_tests;
72+
#[cfg(test)]
73+
#[allow(unused_mut)]
74+
mod chanmon_update_fail_tests;
75+
#[cfg(test)]
76+
#[allow(unused_mut)]
77+
mod dual_funding_tests;
7178
#[cfg(any(test, feature = "_externalize_tests"))]
7279
#[allow(unused_mut)]
7380
pub mod functional_tests;
7481
#[cfg(any(test, feature = "_externalize_tests"))]
7582
#[allow(unused_mut)]
7683
pub mod htlc_reserve_unit_tests;
77-
#[cfg(any(test, feature = "_externalize_tests"))]
78-
#[allow(unused_mut)]
79-
pub mod update_fee_tests;
80-
#[cfg(all(test, splicing))]
81-
#[allow(unused_mut)]
82-
mod splicing_tests;
8384
#[cfg(test)]
8485
#[allow(unused_mut)]
8586
mod max_payment_path_len_tests;
8687
#[cfg(test)]
8788
#[allow(unused_mut)]
88-
mod payment_tests;
89-
#[cfg(test)]
90-
#[allow(unused_mut)]
91-
mod priv_short_conf_tests;
92-
#[cfg(test)]
93-
#[allow(unused_mut)]
94-
mod chanmon_update_fail_tests;
95-
#[cfg(test)]
96-
#[allow(unused_mut)]
97-
mod reorg_tests;
89+
mod monitor_tests;
9890
#[cfg(test)]
9991
#[allow(unused_mut)]
100-
mod reload_tests;
92+
mod offers_tests;
10193
#[cfg(test)]
10294
#[allow(unused_mut)]
10395
mod onion_route_tests;
10496
#[cfg(test)]
10597
#[allow(unused_mut)]
106-
mod monitor_tests;
98+
mod payment_tests;
10799
#[cfg(test)]
108100
#[allow(unused_mut)]
109-
mod shutdown_tests;
101+
mod priv_short_conf_tests;
110102
#[cfg(test)]
111103
mod quiescence_tests;
112104
#[cfg(test)]
113105
#[allow(unused_mut)]
114-
mod async_signer_tests;
106+
mod reload_tests;
115107
#[cfg(test)]
116108
#[allow(unused_mut)]
117-
mod offers_tests;
109+
mod reorg_tests;
118110
#[cfg(test)]
119111
#[allow(unused_mut)]
120-
mod dual_funding_tests;
112+
mod shutdown_tests;
113+
#[cfg(all(test, splicing))]
114+
#[allow(unused_mut)]
115+
mod splicing_tests;
116+
#[cfg(any(test, feature = "_externalize_tests"))]
117+
#[allow(unused_mut)]
118+
pub mod update_fee_tests;
121119

122120
pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;

0 commit comments

Comments
 (0)