Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cron-weekly-rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Nightly 2026-09-23 and later reformat code that stable rustfmt reverts
# (see #1118). Keep the last nightly compatible with stable CI checks.
# Pin a nightly that formats code the same way as stable rustfmt 1.11 (Rust
# 1.100), as the stable CI checks would otherwise reject its changes.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-09-22
toolchain: nightly-2026-11-12
components: rustfmt
- name: Run Nightly rustfmt
# Run the formatter and manually remove trailing whitespace.
run: cargo +nightly-2026-09-22 fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//'
run: cargo +nightly-2026-11-12 fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//'
- name: Get the current date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
Expand Down
3 changes: 2 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2832,7 +2832,8 @@ mod tests {
fn list_paginated(
&self, primary_namespace: &str, secondary_namespace: &str,
page_token: Option<PageToken>,
) -> impl Future<Output = Result<PaginatedListResponse, io::Error>> + 'static + Send {
) -> impl Future<Output = Result<PaginatedListResponse, io::Error>> + 'static + Send
{
PaginatedKVStore::list_paginated(
&self.0,
primary_namespace,
Expand Down
3 changes: 2 additions & 1 deletion src/chain/bitcoind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,8 @@ impl BlockSource for BitcoindClient {

fn get_best_block<'a>(
&'a self,
) -> impl Future<Output = Result<(bitcoin::BlockHash, Option<u32>), BlockSourceError>> + 'a {
) -> impl Future<Output = Result<(bitcoin::BlockHash, Option<u32>), BlockSourceError>> + 'a
{
async move {
match self {
BitcoindClient::Rpc { rpc_client, .. } => rpc_client.get_best_block().await,
Expand Down
30 changes: 20 additions & 10 deletions src/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ mod tests {
impl KVStore for FailingStore {
fn read(
&self, _primary_namespace: &str, _secondary_namespace: &str, _key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "read failed")) }
}

Expand All @@ -968,7 +969,8 @@ mod tests {

fn list(
&self, _primary_namespace: &str, _secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "list failed")) }
}
}
Expand Down Expand Up @@ -1009,7 +1011,8 @@ mod tests {
impl KVStore for GatedStore {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
self.inner.read(primary_namespace, secondary_namespace, key)
}

Expand All @@ -1034,7 +1037,8 @@ mod tests {

fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
self.inner.list(primary_namespace, secondary_namespace)
}
}
Expand Down Expand Up @@ -1418,7 +1422,8 @@ mod tests {
impl KVStore for CountingStore {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
self.reads.fetch_add(1, Ordering::Relaxed);
self.inner.read(primary_namespace, secondary_namespace, key)
}
Expand All @@ -1439,7 +1444,8 @@ mod tests {

fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
self.lists.fetch_add(1, Ordering::Relaxed);
self.inner.list(primary_namespace, secondary_namespace)
}
Expand Down Expand Up @@ -1468,7 +1474,8 @@ mod tests {
impl KVStore for WriteFailingStore {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
self.inner.read(primary_namespace, secondary_namespace, key)
}

Expand Down Expand Up @@ -1500,7 +1507,8 @@ mod tests {

fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
self.inner.list(primary_namespace, secondary_namespace)
}
}
Expand Down Expand Up @@ -1918,7 +1926,8 @@ mod tests {
impl KVStore for PhantomKeyStore {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
self.inner.read(primary_namespace, secondary_namespace, key)
}

Expand All @@ -1936,7 +1945,8 @@ mod tests {

fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
self.inner.list(primary_namespace, secondary_namespace)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/io/in_memory_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ impl PaginatedKVStore for InMemoryStore {
impl MigratableKVStore for InMemoryStore {
fn list_all_keys(
&self,
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send {
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send
{
let res = self.list_all_keys_internal();
async move { res }
}
Expand Down
3 changes: 2 additions & 1 deletion src/io/postgres_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ impl PaginatedKVStore for PostgresStore {
impl MigratableKVStore for PostgresStore {
fn list_all_keys(
&self,
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send {
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send
{
let inner = Arc::clone(&self.inner);
let runtime = self.internal_runtime();
async move {
Expand Down
3 changes: 2 additions & 1 deletion src/io/sqlite_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ impl PaginatedKVStore for SqliteStore {
impl MigratableKVStore for SqliteStore {
fn list_all_keys(
&self,
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send {
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send
{
let inner = Arc::clone(&self.inner);
let runtime = Arc::clone(&self.internal_runtime);
let fut = runtime.handle().spawn_blocking(move || inner.list_all_keys_internal());
Expand Down
3 changes: 2 additions & 1 deletion src/io/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ pub(crate) fn read_or_generate_seed_file(
}

#[cfg(unix)]
let mut f = OpenOptions::new().write(true).create_new(true).mode(0o400).open(keys_seed_path)?;
let mut f =
OpenOptions::new().write(true).create_new(true).mode(0o400).open(keys_seed_path)?;

#[cfg(not(unix))]
let mut f = OpenOptions::new().write(true).create_new(true).open(keys_seed_path)?;
Expand Down
3 changes: 2 additions & 1 deletion src/io/vss_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ impl PaginatedKVStore for VssStore {
impl MigratableKVStore for VssStore {
fn list_all_keys(
&self,
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send {
) -> impl Future<Output = Result<Vec<(String, String, String)>, io::Error>> + 'static + Send
{
let inner = Arc::clone(&self.inner);
let runtime = self.internal_runtime();
async move {
Expand Down
3 changes: 2 additions & 1 deletion src/liquidity/client/lsps2/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ impl<R: Router, ES: EntropySource> Router for LSPS2Router<R, ES> {
.network_graph
.read_only()
.node(&NodeId::from_pubkey(&channel.counterparty.node_id))
.is_some() && channel.counterparty.forwarding_info.is_some()
.is_some()
&& channel.counterparty.forwarding_info.is_some()
};
let direct_path_has_sufficient_liquidity = amount_msats.map_or(true, |amount_msats| {
if allow_mpp {
Expand Down
12 changes: 8 additions & 4 deletions src/liquidity/client/lsps2/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ mod tests {
impl KVStore for FailingStore {
fn read(
&self, _primary_namespace: &str, _secondary_namespace: &str, _key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "read failed")) }
}

Expand All @@ -593,7 +594,8 @@ mod tests {

fn list(
&self, _primary_namespace: &str, _secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "list failed")) }
}
}
Expand Down Expand Up @@ -1080,7 +1082,8 @@ mod tests {
impl KVStore for LeaseRemovalFailingStore {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
KVStore::read(&*self.0, primary_namespace, secondary_namespace, key)
}

Expand All @@ -1107,7 +1110,8 @@ mod tests {

fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
KVStore::list(&*self.0, primary_namespace, secondary_namespace)
}
}
Expand Down
16 changes: 7 additions & 9 deletions src/payment/asynchronous/static_invoice_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ impl StaticInvoiceStore {
)
})
})
.or_else(
|e| {
if e.kind() == lightning::io::ErrorKind::NotFound {
Ok(None)
} else {
Err(e)
}
},
)
.or_else(|e| {
if e.kind() == lightning::io::ErrorKind::NotFound {
Ok(None)
} else {
Err(e)
}
})
}

pub(crate) async fn handle_persist_static_invoice(
Expand Down
6 changes: 4 additions & 2 deletions src/payment/forwarding_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ mod forwarding_stats_tests {
impl KVStore for FailRemoveForKey {
fn read(
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
self.inner.read(primary_namespace, secondary_namespace, key)
}
fn write(
Expand All @@ -1053,7 +1054,8 @@ mod forwarding_stats_tests {
}
fn list(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
self.inner.list(primary_namespace, secondary_namespace)
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/peer_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ mod tests {
impl KVStore for FailingStore {
fn read(
&self, _primary_namespace: &str, _secondary_namespace: &str, _key: &str,
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<u8>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "read failed")) }
}

Expand All @@ -212,7 +213,8 @@ mod tests {

fn list(
&self, _primary_namespace: &str, _secondary_namespace: &str,
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send {
) -> impl std::future::Future<Output = Result<Vec<String>, io::Error>> + 'static + Send
{
async { Err(io::Error::new(io::ErrorKind::Other, "list failed")) }
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ impl<'a> KVStore for dyn DynStoreTrait + 'a {
impl<'a> PaginatedKVStore for dyn DynStoreTrait + 'a {
fn list_paginated(
&self, primary_namespace: &str, secondary_namespace: &str, page_token: Option<PageToken>,
) -> impl Future<Output = Result<PaginatedListResponse, bitcoin::io::Error>> + Send + 'static {
) -> impl Future<Output = Result<PaginatedListResponse, bitcoin::io::Error>> + Send + 'static
{
DynStoreTrait::list_paginated_async(
self,
primary_namespace,
Expand Down Expand Up @@ -156,7 +157,8 @@ impl KVStore for DynStoreRef {
impl PaginatedKVStore for DynStoreRef {
fn list_paginated(
&self, primary_namespace: &str, secondary_namespace: &str, page_token: Option<PageToken>,
) -> impl Future<Output = Result<PaginatedListResponse, bitcoin::io::Error>> + Send + 'static {
) -> impl Future<Output = Result<PaginatedListResponse, bitcoin::io::Error>> + Send + 'static
{
DynStoreTrait::list_paginated_async(
&*self.0,
primary_namespace,
Expand Down Expand Up @@ -189,7 +191,8 @@ impl<T: PaginatedKVStore + Send + Sync> DynStoreTrait for DynStoreWrapper<T> {

fn list_async(
&self, primary_namespace: &str, secondary_namespace: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, bitcoin::io::Error>> + Send + 'static>> {
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, bitcoin::io::Error>> + Send + 'static>>
{
Box::pin(KVStore::list(&self.0, primary_namespace, secondary_namespace))
}

Expand Down
Loading
Loading