From 4f4c1f37d450b0faee4e44cae1e636d3a75d9b05 Mon Sep 17 00:00:00 2001 From: Fmt Bot Date: Sun, 27 Sep 2026 03:09:41 +0000 Subject: [PATCH] 2026-09-27 automated rustfmt nightly --- src/builder.rs | 3 +- src/chain/bitcoind.rs | 3 +- src/data_store.rs | 30 ++++++++++++------- src/io/in_memory_store.rs | 3 +- src/io/postgres_store/mod.rs | 3 +- src/io/sqlite_store/mod.rs | 3 +- src/io/utils.rs | 3 +- src/io/vss_store.rs | 3 +- .../asynchronous/static_invoice_store.rs | 16 +++++----- src/peer_store.rs | 6 ++-- src/types.rs | 9 ++++-- src/wallet/mod.rs | 18 +++++++---- src/wallet/persist.rs | 3 +- tests/common/mod.rs | 6 ++-- tests/integration_tests_rust.rs | 3 +- 15 files changed, 71 insertions(+), 41 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 1158044e4..ee50a2f08 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2702,7 +2702,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &self.0, primary_namespace, diff --git a/src/chain/bitcoind.rs b/src/chain/bitcoind.rs index 9ed38c212..4029d52b5 100644 --- a/src/chain/bitcoind.rs +++ b/src/chain/bitcoind.rs @@ -1375,7 +1375,8 @@ impl BlockSource for BitcoindClient { fn get_best_block<'a>( &'a self, - ) -> impl Future), BlockSourceError>> + 'a { + ) -> impl Future), BlockSourceError>> + 'a + { async move { match self { BitcoindClient::Rpc { rpc_client, .. } => rpc_client.get_best_block().await, diff --git a/src/data_store.rs b/src/data_store.rs index bdd190621..4299df1e8 100644 --- a/src/data_store.rs +++ b/src/data_store.rs @@ -920,7 +920,8 @@ mod tests { impl KVStore for FailingStore { fn read( &self, _primary_namespace: &str, _secondary_namespace: &str, _key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { async { Err(io::Error::new(io::ErrorKind::Other, "read failed")) } } @@ -938,7 +939,8 @@ mod tests { fn list( &self, _primary_namespace: &str, _secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { async { Err(io::Error::new(io::ErrorKind::Other, "list failed")) } } } @@ -979,7 +981,8 @@ mod tests { impl KVStore for GatedStore { fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.read(primary_namespace, secondary_namespace, key) } @@ -1004,7 +1007,8 @@ mod tests { fn list( &self, primary_namespace: &str, secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.list(primary_namespace, secondary_namespace) } } @@ -1358,7 +1362,8 @@ mod tests { impl KVStore for CountingStore { fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.reads.fetch_add(1, Ordering::Relaxed); self.inner.read(primary_namespace, secondary_namespace, key) } @@ -1379,7 +1384,8 @@ mod tests { fn list( &self, primary_namespace: &str, secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.lists.fetch_add(1, Ordering::Relaxed); self.inner.list(primary_namespace, secondary_namespace) } @@ -1408,7 +1414,8 @@ mod tests { impl KVStore for WriteFailingStore { fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.read(primary_namespace, secondary_namespace, key) } @@ -1440,7 +1447,8 @@ mod tests { fn list( &self, primary_namespace: &str, secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.list(primary_namespace, secondary_namespace) } } @@ -1858,7 +1866,8 @@ mod tests { impl KVStore for PhantomKeyStore { fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.read(primary_namespace, secondary_namespace, key) } @@ -1876,7 +1885,8 @@ mod tests { fn list( &self, primary_namespace: &str, secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { self.inner.list(primary_namespace, secondary_namespace) } } diff --git a/src/io/in_memory_store.rs b/src/io/in_memory_store.rs index 82418e7d5..c9ca08d44 100644 --- a/src/io/in_memory_store.rs +++ b/src/io/in_memory_store.rs @@ -214,7 +214,8 @@ impl PaginatedKVStore for InMemoryStore { impl MigratableKVStore for InMemoryStore { fn list_all_keys( &self, - ) -> impl Future, io::Error>> + 'static + Send { + ) -> impl Future, io::Error>> + 'static + Send + { let res = self.list_all_keys_internal(); async move { res } } diff --git a/src/io/postgres_store/mod.rs b/src/io/postgres_store/mod.rs index 4ffb948ff..f0b44c720 100644 --- a/src/io/postgres_store/mod.rs +++ b/src/io/postgres_store/mod.rs @@ -375,7 +375,8 @@ impl PaginatedKVStore for PostgresStore { impl MigratableKVStore for PostgresStore { fn list_all_keys( &self, - ) -> impl Future, io::Error>> + 'static + Send { + ) -> impl Future, io::Error>> + 'static + Send + { let inner = Arc::clone(&self.inner); let runtime = self.internal_runtime(); async move { diff --git a/src/io/sqlite_store/mod.rs b/src/io/sqlite_store/mod.rs index 24e17efa6..d418e22be 100644 --- a/src/io/sqlite_store/mod.rs +++ b/src/io/sqlite_store/mod.rs @@ -214,7 +214,8 @@ impl PaginatedKVStore for SqliteStore { impl MigratableKVStore for SqliteStore { fn list_all_keys( &self, - ) -> impl Future, io::Error>> + 'static + Send { + ) -> impl Future, io::Error>> + 'static + Send + { let inner = Arc::clone(&self.inner); let fut = tokio::task::spawn_blocking(move || inner.list_all_keys_internal()); async move { diff --git a/src/io/utils.rs b/src/io/utils.rs index 31f316659..a0c7c48f8 100644 --- a/src/io/utils.rs +++ b/src/io/utils.rs @@ -87,7 +87,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)?; diff --git a/src/io/vss_store.rs b/src/io/vss_store.rs index 6a44be02d..0e1f2cb62 100644 --- a/src/io/vss_store.rs +++ b/src/io/vss_store.rs @@ -328,7 +328,8 @@ impl PaginatedKVStore for VssStore { impl MigratableKVStore for VssStore { fn list_all_keys( &self, - ) -> impl Future, io::Error>> + 'static + Send { + ) -> impl Future, io::Error>> + 'static + Send + { let inner = Arc::clone(&self.inner); let runtime = self.internal_runtime(); async move { diff --git a/src/payment/asynchronous/static_invoice_store.rs b/src/payment/asynchronous/static_invoice_store.rs index f1e2378c2..20c29a1b9 100644 --- a/src/payment/asynchronous/static_invoice_store.rs +++ b/src/payment/asynchronous/static_invoice_store.rs @@ -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( diff --git a/src/peer_store.rs b/src/peer_store.rs index 8345bf711..b43f1ebd6 100644 --- a/src/peer_store.rs +++ b/src/peer_store.rs @@ -186,7 +186,8 @@ mod tests { impl KVStore for FailingStore { fn read( &self, _primary_namespace: &str, _secondary_namespace: &str, _key: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { async { Err(io::Error::new(io::ErrorKind::Other, "read failed")) } } @@ -204,7 +205,8 @@ mod tests { fn list( &self, _primary_namespace: &str, _secondary_namespace: &str, - ) -> impl std::future::Future, io::Error>> + 'static + Send { + ) -> impl std::future::Future, io::Error>> + 'static + Send + { async { Err(io::Error::new(io::ErrorKind::Other, "list failed")) } } } diff --git a/src/types.rs b/src/types.rs index fd86d1bcd..b944a59bf 100644 --- a/src/types.rs +++ b/src/types.rs @@ -105,7 +105,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, - ) -> impl Future> + Send + 'static { + ) -> impl Future> + Send + 'static + { DynStoreTrait::list_paginated_async( self, primary_namespace, @@ -153,7 +154,8 @@ impl KVStore for DynStoreRef { impl PaginatedKVStore for DynStoreRef { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + Send + 'static { + ) -> impl Future> + Send + 'static + { DynStoreTrait::list_paginated_async( &*self.0, primary_namespace, @@ -186,7 +188,8 @@ impl DynStoreTrait for DynStoreWrapper { fn list_async( &self, primary_namespace: &str, secondary_namespace: &str, - ) -> Pin, bitcoin::io::Error>> + Send + 'static>> { + ) -> Pin, bitcoin::io::Error>> + Send + 'static>> + { Box::pin(KVStore::list(&self.0, primary_namespace, secondary_namespace)) } diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 13a8ef4e0..0443ffe0b 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -2784,7 +2784,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, @@ -3073,7 +3074,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, _page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { let keys = self .data .lock() @@ -3192,7 +3194,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, @@ -3400,7 +3403,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, @@ -3516,7 +3520,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, @@ -3662,7 +3667,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, diff --git a/src/wallet/persist.rs b/src/wallet/persist.rs index 6384d0fce..2223213e1 100644 --- a/src/wallet/persist.rs +++ b/src/wallet/persist.rs @@ -368,7 +368,8 @@ mod tests { fn list_paginated( &self, primary_namespace: &str, secondary_namespace: &str, page_token: Option, - ) -> impl Future> + 'static + Send { + ) -> impl Future> + 'static + Send + { PaginatedKVStore::list_paginated( &*self.inner, primary_namespace, diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 91e23ca16..74d83a8b0 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1851,7 +1851,8 @@ pub(crate) async fn do_channel_full_cycle( + invoice_amount_3_msat + determined_amount_msat + keysend_amount_msat) - / 1000 - splice_out_sat; + / 1000 + - splice_out_sat; let node_a_upper_bound_sat = (premine_amount_sat - funding_amount_sat) + (funding_amount_sat - sum_of_all_payments_sat); let node_a_lower_bound_sat = node_a_upper_bound_sat - onchain_fee_buffer_sat; @@ -2005,7 +2006,8 @@ impl TestSyncStoreInner { ) -> lightning::io::Result> { let fs_res = KVStore::list(&self.fs_store, primary_namespace, secondary_namespace).await; #[cfg(feature = "storage-sqlite")] - let sqlite_res = KVStore::list(&self.sqlite_store, primary_namespace, secondary_namespace).await; + let sqlite_res = + KVStore::list(&self.sqlite_store, primary_namespace, secondary_namespace).await; let test_res = KVStore::list(&self.test_store, primary_namespace, secondary_namespace).await; diff --git a/tests/integration_tests_rust.rs b/tests/integration_tests_rust.rs index 3da60800c..7f3a2f803 100644 --- a/tests/integration_tests_rust.rs +++ b/tests/integration_tests_rust.rs @@ -3338,7 +3338,8 @@ async fn async_payment() { .filter(|n| { node.network_graph().node(n).map_or(false, |info| info.announcement_info.is_some()) }) - .count() >= 2 + .count() + >= 2 }; // Wait for everyone to see all channels and node announcements.