Skip to content

Commit 5b65bf2

Browse files
ben-kaufmanclaude
andcommitted
fix: move inline imports to top of file
Move HashSet (lib.rs) and AtomicBool (builder.rs) to top-level imports per CLAUDE.md: "ALWAYS move imports to the top of the file" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6157ac5 commit 5b65bf2

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/builder.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::collections::HashMap;
99
use std::convert::TryInto;
1010
use std::default::Default;
1111
use std::path::PathBuf;
12-
use std::sync::atomic::AtomicU32;
12+
use std::sync::atomic::{AtomicBool, AtomicU32};
1313
use std::sync::{Arc, Mutex, Once, RwLock};
1414
use std::time::SystemTime;
1515
use std::{fmt, fs};
@@ -2275,9 +2275,7 @@ fn build_with_store_internal(
22752275
async_payments_role,
22762276
runtime_sync_intervals: Arc::new(RwLock::new(RuntimeSyncIntervals::default())),
22772277
local_rgs_timestamp,
2278-
accept_stale_channel_monitors: std::sync::atomic::AtomicBool::new(
2279-
accept_stale_channel_monitors,
2280-
),
2278+
accept_stale_channel_monitors: AtomicBool::new(accept_stale_channel_monitors),
22812279
})
22822280
}
22832281

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ mod tx_broadcaster;
102102
mod types;
103103
mod wallet;
104104

105-
use std::collections::HashMap;
105+
use std::collections::{HashMap, HashSet};
106106
use std::default::Default;
107107
use std::net::ToSocketAddrs;
108108
use std::ops::Deref;
@@ -731,7 +731,7 @@ impl Node {
731731
// Deduplicate by counterparty — one payment per peer is enough to trigger
732732
// a commitment round-trip. If a peer has multiple channels, each retry
733733
// attempt may route through a different channel as outbound capacity shifts.
734-
let mut seen_peers = std::collections::HashSet::new();
734+
let mut seen_peers = HashSet::new();
735735
for (_, counterparty_node_id, _) in &initial_update_ids {
736736
if !seen_peers.insert(*counterparty_node_id) {
737737
continue;
@@ -811,7 +811,7 @@ impl Node {
811811
// Dedup by peer — the router may pick a different channel on each retry.
812812
if last_retry_time.elapsed() >= retry_interval {
813813
last_retry_time = tokio::time::Instant::now();
814-
let mut retried_peers = std::collections::HashSet::new();
814+
let mut retried_peers = HashSet::new();
815815
for (ch_id, counterparty_node_id, initial_id) in &initial_update_ids {
816816
let healed = chain_monitor
817817
.get_monitor(*ch_id)

0 commit comments

Comments
 (0)