Skip to content

Commit dd51908

Browse files
authored
Merge pull request #669 from tnull/2025-10-nightly-rustfmt-followup
Nightly `rustfmt` follow-up
2 parents da51546 + 2590ee5 commit dd51908

File tree

7 files changed

+46
-16
lines changed

7 files changed

+46
-16
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Nightly rustfmt
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
5+
workflow_dispatch: # allows manual triggering
6+
jobs:
7+
format:
8+
name: Nightly rustfmt
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v5
12+
- uses: dtolnay/rust-toolchain@nightly
13+
with:
14+
components: rustfmt
15+
- name: Run Nightly rustfmt
16+
# Run the formatter and manually remove trailing whitespace.
17+
run: cargo +nightly fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//'
18+
- name: Get the current date
19+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
20+
- name: Create Pull Request
21+
uses: peter-evans/create-pull-request@v7
22+
with:
23+
author: Fmt Bot <[email protected]>
24+
title: Automated nightly rustfmt (${{ env.date }})
25+
body: |
26+
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
27+
commit-message: ${{ env.date }} automated rustfmt nightly
28+
labels: rustfmt

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Elias Rohrer <[email protected]>"]
55
homepage = "https://lightningdevkit.org/"
66
license = "MIT OR Apache-2.0"
77
edition = "2021"
8+
rust-version = "1.85"
89
description = "A ready-to-go node implementation built using LDK."
910
repository = "https://github.com/lightningdevkit/ldk-node/"
1011
readme = "README.md"

rust-toolchain.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use_field_init_shorthand = true
55
max_width = 100
66
match_block_trailing_comma = true
77
format_code_in_doc_comments = true
8-
overflow_delimited_expr = true
98
comment_width = 100
109
format_macro_matchers = true
1110
group_imports = "StdExternalCrate"
@@ -17,3 +16,4 @@ style_edition = "2021"
1716
# TBD: do we want comment and string wrapping?
1817
#wrap_comments = true
1918
#format_strings = true
19+
#overflow_delimited_expr = true

src/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,10 @@ impl NodeBuilder {
628628
derive_xprv(config, &seed_bytes, VSS_HARDENED_CHILD_INDEX, Arc::clone(&logger))?;
629629

630630
let lnurl_auth_xprv = vss_xprv
631-
.derive_priv(&Secp256k1::new(), &[ChildNumber::Hardened {
632-
index: VSS_LNURL_AUTH_HARDENED_CHILD_INDEX,
633-
}])
631+
.derive_priv(
632+
&Secp256k1::new(),
633+
&[ChildNumber::Hardened { index: VSS_LNURL_AUTH_HARDENED_CHILD_INDEX }],
634+
)
634635
.map_err(|e| {
635636
log_error!(logger, "Failed to derive VSS secret: {}", e);
636637
BuildError::KVStoreSetupFailed

src/chain/bitcoind.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,10 @@ impl BitcoindClient {
701701
let num_blocks_json = serde_json::json!(num_blocks);
702702
let estimation_mode_json = serde_json::json!(estimation_mode);
703703
rpc_client
704-
.call_method::<FeeResponse>("estimatesmartfee", &[
705-
num_blocks_json,
706-
estimation_mode_json,
707-
])
704+
.call_method::<FeeResponse>(
705+
"estimatesmartfee",
706+
&[num_blocks_json, estimation_mode_json],
707+
)
708708
.await
709709
.map(|resp| resp.0)
710710
}

src/payment/asynchronous/static_invoice_store.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,14 @@ mod tests {
271271
}
272272

273273
fn blinded_path() -> BlindedMessagePath {
274-
BlindedMessagePath::from_blinded_path(pubkey(40), pubkey(41), vec![
275-
BlindedHop { blinded_node_id: pubkey(42), encrypted_payload: vec![0; 43] },
276-
BlindedHop { blinded_node_id: pubkey(43), encrypted_payload: vec![0; 44] },
277-
])
274+
BlindedMessagePath::from_blinded_path(
275+
pubkey(40),
276+
pubkey(41),
277+
vec![
278+
BlindedHop { blinded_node_id: pubkey(42), encrypted_payload: vec![0; 43] },
279+
BlindedHop { blinded_node_id: pubkey(43), encrypted_payload: vec![0; 44] },
280+
],
281+
)
278282
}
279283

280284
fn pubkey(byte: u8) -> PublicKey {

0 commit comments

Comments
 (0)