From f04804ae2506168f59858ef2dde6c04cf8a17fcc Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 18 Apr 2026 22:57:14 -0400 Subject: [PATCH] chore(fmt): rustfmt drift cleanup across misc crates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pure formatter output — no semantic changes. Sweeping these into their own commit so the FIPS integration diff that follows stays scoped to the actual feature. Co-Authored-By: Claude Opus 4.7 (1M context) --- core/archipelago/src/api/rpc/package/install.rs | 4 +--- core/archipelago/src/api/rpc/package/progress.rs | 5 +---- core/archipelago/src/auth.rs | 1 - .../archipelago/src/container/dev_orchestrator.rs | 13 ++++++------- core/archipelago/src/content_server.rs | 6 +++--- core/archipelago/src/health_monitor.rs | 15 +++++++++------ core/archipelago/src/mesh/ratchet.rs | 5 +---- core/archipelago/src/mesh/steganography.rs | 10 +++------- core/archipelago/src/network/dwn_sync.rs | 1 - core/archipelago/src/update.rs | 1 - 10 files changed, 24 insertions(+), 37 deletions(-) diff --git a/core/archipelago/src/api/rpc/package/install.rs b/core/archipelago/src/api/rpc/package/install.rs index 48ce6c3e..6fa0b50f 100644 --- a/core/archipelago/src/api/rpc/package/install.rs +++ b/core/archipelago/src/api/rpc/package/install.rs @@ -567,9 +567,7 @@ impl RpcHandler { .output() .await .ok(); - check.is_some_and(|o| { - !String::from_utf8_lossy(&o.stdout).trim().is_empty() - }) + check.is_some_and(|o| !String::from_utf8_lossy(&o.stdout).trim().is_empty()) } else { false }; diff --git a/core/archipelago/src/api/rpc/package/progress.rs b/core/archipelago/src/api/rpc/package/progress.rs index 9817330f..b9622421 100644 --- a/core/archipelago/src/api/rpc/package/progress.rs +++ b/core/archipelago/src/api/rpc/package/progress.rs @@ -110,10 +110,7 @@ fn parse_size_value(s: &str) -> Option { let s = s.trim(); let (num_str, multiplier) = if let Some(pos) = s.rfind("GiB") { - ( - s[..pos].split_whitespace().last()?, - 1024 * 1024 * 1024, - ) + (s[..pos].split_whitespace().last()?, 1024 * 1024 * 1024) } else if let Some(pos) = s.rfind("MiB") { (s[..pos].split_whitespace().last()?, 1024 * 1024) } else if let Some(pos) = s.rfind("KiB") { diff --git a/core/archipelago/src/auth.rs b/core/archipelago/src/auth.rs index 606a08c7..b4f62e71 100644 --- a/core/archipelago/src/auth.rs +++ b/core/archipelago/src/auth.rs @@ -22,7 +22,6 @@ pub enum UserRole { AppUser, } - impl UserRole { /// Check if this role allows a given RPC method. pub fn can_access(&self, method: &str) -> bool { diff --git a/core/archipelago/src/container/dev_orchestrator.rs b/core/archipelago/src/container/dev_orchestrator.rs index 8d2f333b..d6cf0d36 100644 --- a/core/archipelago/src/container/dev_orchestrator.rs +++ b/core/archipelago/src/container/dev_orchestrator.rs @@ -73,13 +73,12 @@ impl DevContainerOrchestrator { version: _, } = dep { - if dep_id == "bitcoin-core" - && !self.bitcoin_simulator.is_bitcoin_available() { - return Err(anyhow::anyhow!( - "Bitcoin Core dependency not satisfied (simulation: {:?})", - self.bitcoin_simulator.mode() - )); - } + if dep_id == "bitcoin-core" && !self.bitcoin_simulator.is_bitcoin_available() { + return Err(anyhow::anyhow!( + "Bitcoin Core dependency not satisfied (simulation: {:?})", + self.bitcoin_simulator.mode() + )); + } } } } diff --git a/core/archipelago/src/content_server.rs b/core/archipelago/src/content_server.rs index f4ccd37b..2566388e 100644 --- a/core/archipelago/src/content_server.rs +++ b/core/archipelago/src/content_server.rs @@ -42,7 +42,6 @@ pub enum Availability { Specific { peers: Vec }, } - #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] #[derive(Default)] @@ -50,10 +49,11 @@ pub enum AccessControl { #[default] Free, PeersOnly, - Paid { price_sats: u64 }, + Paid { + price_sats: u64, + }, } - #[derive(Debug, Default, Serialize, Deserialize)] pub struct ContentCatalog { pub items: Vec, diff --git a/core/archipelago/src/health_monitor.rs b/core/archipelago/src/health_monitor.rs index 756d435d..d506c05b 100644 --- a/core/archipelago/src/health_monitor.rs +++ b/core/archipelago/src/health_monitor.rs @@ -560,12 +560,15 @@ pub fn spawn_health_monitor(state: Arc, data_dir: PathBuf) { if deps .iter() .any(|d| *d == recovered_id || *d == container.name) - && tracker.attempt_count(&other.name) > 0 { - info!("Resetting restart counter for {} (dependency {} recovered)", - other.name, container.name); - tracker.clear(&other.name); - restart_history.clear(&other.name); - } + && tracker.attempt_count(&other.name) > 0 + { + info!( + "Resetting restart counter for {} (dependency {} recovered)", + other.name, container.name + ); + tracker.clear(&other.name); + restart_history.clear(&other.name); + } } tracker.clear(&container.name); restart_history.clear(&container.name); diff --git a/core/archipelago/src/mesh/ratchet.rs b/core/archipelago/src/mesh/ratchet.rs index 0a01926e..bfc72922 100644 --- a/core/archipelago/src/mesh/ratchet.rs +++ b/core/archipelago/src/mesh/ratchet.rs @@ -285,10 +285,7 @@ impl RatchetState { if let Some(mut chain_key) = self.chain_key_recv { while self.recv_n < until { let (new_chain_key, message_key) = kdf_chain_key(&chain_key)?; - let dh_hex = self - .dh_remote_public - .map(hex::encode) - .unwrap_or_default(); + let dh_hex = self.dh_remote_public.map(hex::encode).unwrap_or_default(); self.skipped_keys.insert((dh_hex, self.recv_n), message_key); chain_key = new_chain_key; self.recv_n += 1; diff --git a/core/archipelago/src/mesh/steganography.rs b/core/archipelago/src/mesh/steganography.rs index 8846fe93..0fa6983a 100644 --- a/core/archipelago/src/mesh/steganography.rs +++ b/core/archipelago/src/mesh/steganography.rs @@ -20,8 +20,7 @@ use serde::{Deserialize, Serialize}; pub const STEGO_MARKER: u8 = 0xAA; /// Steganography mode — how real payload bytes are disguised on the wire. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] -#[derive(Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] pub enum SteganographyMode { /// No steganography — standard 0x02 typed envelope. #[default] @@ -34,7 +33,6 @@ pub enum SteganographyMode { SensorNetwork, } - impl SteganographyMode { pub fn from_u8(v: u8) -> Option { match v { @@ -276,13 +274,11 @@ pub fn wire_size(mode: SteganographyMode, payload_len: usize) -> usize { match mode { SteganographyMode::Normal => payload_len, SteganographyMode::WeatherStation => { - let blocks = - payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK); + let blocks = payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK); header + blocks * WEATHER_WIRE_BYTES_PER_BLOCK } SteganographyMode::SensorNetwork => { - let blocks = - payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK); + let blocks = payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK); header + blocks * SENSOR_WIRE_BYTES_PER_BLOCK } } diff --git a/core/archipelago/src/network/dwn_sync.rs b/core/archipelago/src/network/dwn_sync.rs index db9d90b5..c033628c 100644 --- a/core/archipelago/src/network/dwn_sync.rs +++ b/core/archipelago/src/network/dwn_sync.rs @@ -23,7 +23,6 @@ pub enum SyncStatus { Error, } - /// DWN sync state persisted to disk. #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct DwnSyncState { diff --git a/core/archipelago/src/update.rs b/core/archipelago/src/update.rs index 34323141..ce9e2021 100644 --- a/core/archipelago/src/update.rs +++ b/core/archipelago/src/update.rs @@ -44,7 +44,6 @@ pub enum UpdateSchedule { AutoApply, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct UpdateState { pub current_version: String,