chore(fmt): rustfmt drift cleanup across misc crates

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) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-18 22:57:14 -04:00
parent 58e9754cf2
commit f04804ae25
10 changed files with 24 additions and 37 deletions

View File

@ -567,9 +567,7 @@ impl RpcHandler {
.output() .output()
.await .await
.ok(); .ok();
check.is_some_and(|o| { check.is_some_and(|o| !String::from_utf8_lossy(&o.stdout).trim().is_empty())
!String::from_utf8_lossy(&o.stdout).trim().is_empty()
})
} else { } else {
false false
}; };

View File

@ -110,10 +110,7 @@ fn parse_size_value(s: &str) -> Option<u64> {
let s = s.trim(); let s = s.trim();
let (num_str, multiplier) = if let Some(pos) = s.rfind("GiB") { 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") { } else if let Some(pos) = s.rfind("MiB") {
(s[..pos].split_whitespace().last()?, 1024 * 1024) (s[..pos].split_whitespace().last()?, 1024 * 1024)
} else if let Some(pos) = s.rfind("KiB") { } else if let Some(pos) = s.rfind("KiB") {

View File

@ -22,7 +22,6 @@ pub enum UserRole {
AppUser, AppUser,
} }
impl UserRole { impl UserRole {
/// Check if this role allows a given RPC method. /// Check if this role allows a given RPC method.
pub fn can_access(&self, method: &str) -> bool { pub fn can_access(&self, method: &str) -> bool {

View File

@ -73,8 +73,7 @@ impl DevContainerOrchestrator {
version: _, version: _,
} = dep } = dep
{ {
if dep_id == "bitcoin-core" if dep_id == "bitcoin-core" && !self.bitcoin_simulator.is_bitcoin_available() {
&& !self.bitcoin_simulator.is_bitcoin_available() {
return Err(anyhow::anyhow!( return Err(anyhow::anyhow!(
"Bitcoin Core dependency not satisfied (simulation: {:?})", "Bitcoin Core dependency not satisfied (simulation: {:?})",
self.bitcoin_simulator.mode() self.bitcoin_simulator.mode()

View File

@ -42,7 +42,6 @@ pub enum Availability {
Specific { peers: Vec<String> }, Specific { peers: Vec<String> },
} }
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[derive(Default)] #[derive(Default)]
@ -50,10 +49,11 @@ pub enum AccessControl {
#[default] #[default]
Free, Free,
PeersOnly, PeersOnly,
Paid { price_sats: u64 }, Paid {
price_sats: u64,
},
} }
#[derive(Debug, Default, Serialize, Deserialize)] #[derive(Debug, Default, Serialize, Deserialize)]
pub struct ContentCatalog { pub struct ContentCatalog {
pub items: Vec<ContentItem>, pub items: Vec<ContentItem>,

View File

@ -560,9 +560,12 @@ pub fn spawn_health_monitor(state: Arc<StateManager>, data_dir: PathBuf) {
if deps if deps
.iter() .iter()
.any(|d| *d == recovered_id || *d == container.name) .any(|d| *d == recovered_id || *d == container.name)
&& tracker.attempt_count(&other.name) > 0 { && tracker.attempt_count(&other.name) > 0
info!("Resetting restart counter for {} (dependency {} recovered)", {
other.name, container.name); info!(
"Resetting restart counter for {} (dependency {} recovered)",
other.name, container.name
);
tracker.clear(&other.name); tracker.clear(&other.name);
restart_history.clear(&other.name); restart_history.clear(&other.name);
} }

View File

@ -285,10 +285,7 @@ impl RatchetState {
if let Some(mut chain_key) = self.chain_key_recv { if let Some(mut chain_key) = self.chain_key_recv {
while self.recv_n < until { while self.recv_n < until {
let (new_chain_key, message_key) = kdf_chain_key(&chain_key)?; let (new_chain_key, message_key) = kdf_chain_key(&chain_key)?;
let dh_hex = self let dh_hex = self.dh_remote_public.map(hex::encode).unwrap_or_default();
.dh_remote_public
.map(hex::encode)
.unwrap_or_default();
self.skipped_keys.insert((dh_hex, self.recv_n), message_key); self.skipped_keys.insert((dh_hex, self.recv_n), message_key);
chain_key = new_chain_key; chain_key = new_chain_key;
self.recv_n += 1; self.recv_n += 1;

View File

@ -20,8 +20,7 @@ use serde::{Deserialize, Serialize};
pub const STEGO_MARKER: u8 = 0xAA; pub const STEGO_MARKER: u8 = 0xAA;
/// Steganography mode — how real payload bytes are disguised on the wire. /// Steganography mode — how real payload bytes are disguised on the wire.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
#[derive(Default)]
pub enum SteganographyMode { pub enum SteganographyMode {
/// No steganography — standard 0x02 typed envelope. /// No steganography — standard 0x02 typed envelope.
#[default] #[default]
@ -34,7 +33,6 @@ pub enum SteganographyMode {
SensorNetwork, SensorNetwork,
} }
impl SteganographyMode { impl SteganographyMode {
pub fn from_u8(v: u8) -> Option<Self> { pub fn from_u8(v: u8) -> Option<Self> {
match v { match v {
@ -276,13 +274,11 @@ pub fn wire_size(mode: SteganographyMode, payload_len: usize) -> usize {
match mode { match mode {
SteganographyMode::Normal => payload_len, SteganographyMode::Normal => payload_len,
SteganographyMode::WeatherStation => { SteganographyMode::WeatherStation => {
let blocks = let blocks = payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK);
payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK);
header + blocks * WEATHER_WIRE_BYTES_PER_BLOCK header + blocks * WEATHER_WIRE_BYTES_PER_BLOCK
} }
SteganographyMode::SensorNetwork => { SteganographyMode::SensorNetwork => {
let blocks = let blocks = payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK);
payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK);
header + blocks * SENSOR_WIRE_BYTES_PER_BLOCK header + blocks * SENSOR_WIRE_BYTES_PER_BLOCK
} }
} }

View File

@ -23,7 +23,6 @@ pub enum SyncStatus {
Error, Error,
} }
/// DWN sync state persisted to disk. /// DWN sync state persisted to disk.
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DwnSyncState { pub struct DwnSyncState {

View File

@ -44,7 +44,6 @@ pub enum UpdateSchedule {
AutoApply, AutoApply,
} }
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateState { pub struct UpdateState {
pub current_version: String, pub current_version: String,