Skip to content

Commit d271b2e

Browse files
committed
Run rustfmt after Rust 2024 edition bump
The edition migration changes `rustfmt` output across the workspace. Keeping the formatting-only delta separate leaves the preceding commit focused on manifest and compatibility changes. Co-Authored-By: HAL 9000
1 parent c59260e commit d271b2e

50 files changed

Lines changed: 1066 additions & 1066 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fuzz/src/chanmon_consistency.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
16061606
loop {
16071607
// Push any events from Node B onto ba_events and bc_events
16081608
macro_rules! push_excess_b_events {
1609-
($excess_events: expr, $expect_drop_node: expr) => { {
1609+
($excess_events: expr, $expect_drop_node: expr) => {{
16101610
let a_id = nodes[0].get_our_node_id();
16111611
let expect_drop_node: Option<usize> = $expect_drop_node;
16121612
let expect_drop_id = if let Some(id) = expect_drop_node {
@@ -1770,7 +1770,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
17701770
ba_events.push(event);
17711771
} else {
17721772
bc_events.push(event);
1773-
}
1773+
}
17741774
}
17751775
}};
17761776
}
@@ -1793,7 +1793,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
17931793
}
17941794

17951795
macro_rules! process_msg_events {
1796-
($node: expr, $corrupt_forward: expr, $limit_events: expr) => { {
1796+
($node: expr, $corrupt_forward: expr, $limit_events: expr) => {{
17971797
let mut events = if $node == 1 {
17981798
let mut new_events = Vec::new();
17991799
mem::swap(&mut new_events, &mut ba_events);
@@ -1930,11 +1930,11 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
19301930
node_id,
19311931
channel_id,
19321932
updates: CommitmentUpdate {
1933-
update_add_htlcs: Vec::new(),
1934-
update_fail_htlcs: Vec::new(),
1935-
update_fulfill_htlcs: Vec::new(),
1936-
update_fail_malformed_htlcs: Vec::new(),
1937-
update_fee: None,
1933+
update_add_htlcs: Vec::new(),
1934+
update_fail_htlcs: Vec::new(),
1935+
update_fulfill_htlcs: Vec::new(),
1936+
update_fail_malformed_htlcs: Vec::new(),
1937+
update_fee: None,
19381938
commitment_signed,
19391939
},
19401940
});

lightning-background-processor/src/lib.rs

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ pub enum GossipSync<
211211
}
212212

213213
impl<
214-
P: Deref<Target = P2PGossipSync<G, U, L>>,
215-
R: Deref<Target = RapidGossipSync<G, L>>,
216-
G: Deref<Target = NetworkGraph<L>>,
217-
U: UtxoLookup,
218-
L: Logger,
219-
> GossipSync<P, R, G, U, L>
214+
P: Deref<Target = P2PGossipSync<G, U, L>>,
215+
R: Deref<Target = RapidGossipSync<G, L>>,
216+
G: Deref<Target = NetworkGraph<L>>,
217+
U: UtxoLookup,
218+
L: Logger,
219+
> GossipSync<P, R, G, U, L>
220220
{
221221
fn network_graph(&self) -> Option<&G> {
222222
match self {
@@ -251,11 +251,11 @@ impl<
251251

252252
/// This is not exported to bindings users as the bindings concretize everything and have constructors for us
253253
impl<
254-
P: Deref<Target = P2PGossipSync<G, U, L>>,
255-
G: Deref<Target = NetworkGraph<L>>,
256-
U: UtxoLookup,
257-
L: Logger,
258-
> GossipSync<P, &RapidGossipSync<G, L>, G, U, L>
254+
P: Deref<Target = P2PGossipSync<G, U, L>>,
255+
G: Deref<Target = NetworkGraph<L>>,
256+
U: UtxoLookup,
257+
L: Logger,
258+
> GossipSync<P, &RapidGossipSync<G, L>, G, U, L>
259259
{
260260
/// Initializes a new [`GossipSync::P2P`] variant.
261261
pub fn p2p(gossip_sync: P) -> Self {
@@ -512,13 +512,13 @@ pub(crate) mod futures_util {
512512
}
513513

514514
impl<
515-
A: Future<Output = bool> + Unpin,
516-
B: Future<Output = ()> + Unpin,
517-
C: Future<Output = ()> + Unpin,
518-
D: Future<Output = ()> + Unpin,
519-
E: Future<Output = ()> + Unpin,
520-
F: Future<Output = ()> + Unpin,
521-
> Future for Selector<A, B, C, D, E, F>
515+
A: Future<Output = bool> + Unpin,
516+
B: Future<Output = ()> + Unpin,
517+
C: Future<Output = ()> + Unpin,
518+
D: Future<Output = ()> + Unpin,
519+
E: Future<Output = ()> + Unpin,
520+
F: Future<Output = ()> + Unpin,
521+
> Future for Selector<A, B, C, D, E, F>
522522
{
523523
type Output = SelectorOutput;
524524
fn poll(
@@ -615,13 +615,13 @@ pub(crate) mod futures_util {
615615
}
616616

617617
impl<
618-
ERR,
619-
A: Future<Output = Result<(), ERR>> + Unpin,
620-
B: Future<Output = Result<(), ERR>> + Unpin,
621-
C: Future<Output = Result<(), ERR>> + Unpin,
622-
D: Future<Output = Result<(), ERR>> + Unpin,
623-
E: Future<Output = Result<(), ERR>> + Unpin,
624-
> Joiner<ERR, A, B, C, D, E>
618+
ERR,
619+
A: Future<Output = Result<(), ERR>> + Unpin,
620+
B: Future<Output = Result<(), ERR>> + Unpin,
621+
C: Future<Output = Result<(), ERR>> + Unpin,
622+
D: Future<Output = Result<(), ERR>> + Unpin,
623+
E: Future<Output = Result<(), ERR>> + Unpin,
624+
> Joiner<ERR, A, B, C, D, E>
625625
{
626626
pub(crate) fn new() -> Self {
627627
Self {
@@ -654,13 +654,13 @@ pub(crate) mod futures_util {
654654
}
655655

656656
impl<
657-
ERR,
658-
A: Future<Output = Result<(), ERR>> + Unpin,
659-
B: Future<Output = Result<(), ERR>> + Unpin,
660-
C: Future<Output = Result<(), ERR>> + Unpin,
661-
D: Future<Output = Result<(), ERR>> + Unpin,
662-
E: Future<Output = Result<(), ERR>> + Unpin,
663-
> Future for Joiner<ERR, A, B, C, D, E>
657+
ERR,
658+
A: Future<Output = Result<(), ERR>> + Unpin,
659+
B: Future<Output = Result<(), ERR>> + Unpin,
660+
C: Future<Output = Result<(), ERR>> + Unpin,
661+
D: Future<Output = Result<(), ERR>> + Unpin,
662+
E: Future<Output = Result<(), ERR>> + Unpin,
663+
> Future for Joiner<ERR, A, B, C, D, E>
664664
where
665665
Joiner<ERR, A, B, C, D, E>: Unpin,
666666
{
@@ -946,43 +946,43 @@ where
946946
D::Target: ChangeDestinationSource,
947947
{
948948
let async_event_handler = async |event| {
949-
let network_graph = gossip_sync.network_graph();
950-
let event_handler = &event_handler;
951-
let scorer = &scorer;
952-
let logger = &logger;
953-
let kv_store = &kv_store;
954-
let fetch_time = &fetch_time;
955-
if let Some(network_graph) = network_graph {
956-
handle_network_graph_update(network_graph, &event)
957-
}
949+
let network_graph = gossip_sync.network_graph();
950+
let event_handler = &event_handler;
951+
let scorer = &scorer;
952+
let logger = &logger;
953+
let kv_store = &kv_store;
954+
let fetch_time = &fetch_time;
955+
if let Some(network_graph) = network_graph {
956+
handle_network_graph_update(network_graph, &event)
957+
}
958958
if let Some(scorer) = scorer {
959-
if let Some(duration_since_epoch) = fetch_time() {
960-
if update_scorer(scorer, &event, duration_since_epoch) {
961-
log_trace!(logger, "Persisting scorer after update");
962-
if let Err(e) = kv_store
963-
.write(
964-
SCORER_PERSISTENCE_PRIMARY_NAMESPACE,
965-
SCORER_PERSISTENCE_SECONDARY_NAMESPACE,
966-
SCORER_PERSISTENCE_KEY,
967-
scorer.encode(),
968-
)
969-
.await
970-
{
959+
if let Some(duration_since_epoch) = fetch_time() {
960+
if update_scorer(scorer, &event, duration_since_epoch) {
961+
log_trace!(logger, "Persisting scorer after update");
962+
if let Err(e) = kv_store
963+
.write(
964+
SCORER_PERSISTENCE_PRIMARY_NAMESPACE,
965+
SCORER_PERSISTENCE_SECONDARY_NAMESPACE,
966+
SCORER_PERSISTENCE_KEY,
967+
scorer.encode(),
968+
)
969+
.await
970+
{
971971
log_error!(
972972
logger,
973973
"Error: Failed to persist scorer, check your disk and permissions {}",
974974
e
975975
);
976-
// We opt not to abort early on persistence failure here as persisting
977-
// the scorer is non-critical and we still hope that it will have
978-
// resolved itself when it is potentially critical in event handling
979-
// below.
980-
}
976+
// We opt not to abort early on persistence failure here as persisting
977+
// the scorer is non-critical and we still hope that it will have
978+
// resolved itself when it is potentially critical in event handling
979+
// below.
981980
}
982981
}
983982
}
984-
event_handler(event).await
985-
};
983+
}
984+
event_handler(event).await
985+
};
986986
let mut batch_delay = BatchDelay::new();
987987

988988
log_trace!(logger, "Calling ChannelManager's timer_tick_occurred on startup");
@@ -1259,10 +1259,10 @@ where
12591259
.await
12601260
{
12611261
log_error!(
1262-
logger,
1263-
"Error: Failed to persist scorer, check your disk and permissions {}",
1264-
e
1265-
);
1262+
logger,
1263+
"Error: Failed to persist scorer, check your disk and permissions {}",
1264+
e
1265+
);
12661266
}
12671267

12681268
Ok(())

lightning-block-sync/src/gossip.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ pub(crate) struct Joiner<
7070
}
7171

7272
impl<
73-
'a,
74-
A: Future<Output = Result<(BlockHash, Option<u32>), BlockSourceError>>,
75-
B: Future<Output = Result<BlockHash, BlockSourceError>>,
76-
> Joiner<'a, A, B>
73+
'a,
74+
A: Future<Output = Result<(BlockHash, Option<u32>), BlockSourceError>>,
75+
B: Future<Output = Result<BlockHash, BlockSourceError>>,
76+
> Joiner<'a, A, B>
7777
{
7878
fn new(a: Pin<&'a mut A>, b: Pin<&'a mut B>) -> Self {
7979
Self { a, b, a_res: None, b_res: None }
8080
}
8181
}
8282

8383
impl<
84-
'a,
85-
A: Future<Output = Result<(BlockHash, Option<u32>), BlockSourceError>>,
86-
B: Future<Output = Result<BlockHash, BlockSourceError>>,
87-
> Future for Joiner<'a, A, B>
84+
'a,
85+
A: Future<Output = Result<(BlockHash, Option<u32>), BlockSourceError>>,
86+
B: Future<Output = Result<BlockHash, BlockSourceError>>,
87+
> Future for Joiner<'a, A, B>
8888
{
8989
type Output = Result<((BlockHash, Option<u32>), BlockHash), BlockSourceError>;
9090
fn poll(mut self: Pin<&mut Self>, ctx: &mut core::task::Context<'_>) -> Poll<Self::Output> {

lightning-invoice/src/de.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,20 +1100,20 @@ mod test {
11001100
},
11011101
data: RawDataPart {
11021102
timestamp: PositiveTimestamp::from_unix_timestamp(1496314658).unwrap(),
1103-
tagged_fields: vec ! [
1104-
crate::TaggedField::PaymentHash(crate::PaymentHash(
1105-
<[u8; 32]>::try_from(
1106-
Vec::from_hex(
1107-
"0001020304050607080900010203040506070809000102030405060708090102",
1108-
)
1109-
.unwrap(),
1110-
)
1111-
.unwrap(),
1112-
))
1113-
.into(),
1103+
tagged_fields: vec![
1104+
crate::TaggedField::PaymentHash(crate::PaymentHash(
1105+
<[u8; 32]>::try_from(
1106+
Vec::from_hex(
1107+
"0001020304050607080900010203040506070809000102030405060708090102",
1108+
)
1109+
.unwrap(),
1110+
)
1111+
.unwrap(),
1112+
))
1113+
.into(),
11141114
Description(crate::Description::new("coffee beans".to_owned()).unwrap())
11151115
.into(),
1116-
PaymentSecret(crate::PaymentSecret([17; 32])).into(),
1116+
PaymentSecret(crate::PaymentSecret([17; 32])).into(),
11171117
Features(expected_features).into(),
11181118
],
11191119
},

lightning-invoice/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ impl<H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Bool>
771771
self, description: Bolt11InvoiceDescription,
772772
) -> InvoiceBuilder<tb::True, H, T, C, S, M> {
773773
match description {
774-
Bolt11InvoiceDescription::Direct(desc) => self.description(desc.0 .0),
774+
Bolt11InvoiceDescription::Direct(desc) => self.description(desc.0.0),
775775
Bolt11InvoiceDescription::Hash(hash) => self.description_hash(hash.0),
776776
}
777777
}
@@ -781,7 +781,7 @@ impl<H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Bool>
781781
self, description_ref: Bolt11InvoiceDescriptionRef<'_>,
782782
) -> InvoiceBuilder<tb::True, H, T, C, S, M> {
783783
match description_ref {
784-
Bolt11InvoiceDescriptionRef::Direct(desc) => self.description(desc.clone().0 .0),
784+
Bolt11InvoiceDescriptionRef::Direct(desc) => self.description(desc.clone().0.0),
785785
Bolt11InvoiceDescriptionRef::Hash(hash) => self.description_hash(hash.0),
786786
}
787787
}
@@ -2016,7 +2016,7 @@ mod test {
20162016
hrp: RawHrp { currency: Currency::Bitcoin, raw_amount: None, si_prefix: None },
20172017
data: RawDataPart {
20182018
timestamp: PositiveTimestamp::from_unix_timestamp(1496314658).unwrap(),
2019-
tagged_fields: vec ! [
2019+
tagged_fields: vec![
20202020
crate::TaggedField::PaymentHash(PaymentHash(
20212021
<[u8; 32]>::try_from(
20222022
Vec::from_hex(

lightning-invoice/src/ser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ impl Base32Len for Sha256 {
306306

307307
impl Base32Iterable for Description {
308308
fn fe_iter<'s>(&'s self) -> impl Iterator<Item = Fe32> + 's {
309-
self.0 .0.as_bytes().fe_iter()
309+
self.0.0.as_bytes().fe_iter()
310310
}
311311
}
312312

313313
impl Base32Len for Description {
314314
fn base32_len(&self) -> usize {
315-
self.0 .0.as_bytes().base32_len()
315+
self.0.0.as_bytes().base32_len()
316316
}
317317
}
318318

@@ -405,7 +405,7 @@ impl Base32Iterable for PrivateRoute {
405405
i1.chain(i2).chain(i3).chain(i4).chain(i5)
406406
}
407407

408-
self.0 .0.iter().map(serialize_to_iter).flatten().bytes_to_fes()
408+
self.0.0.iter().map(serialize_to_iter).flatten().bytes_to_fes()
409409
}
410410
}
411411

0 commit comments

Comments
 (0)