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()
.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
};

View File

@@ -110,10 +110,7 @@ fn parse_size_value(s: &str) -> Option<u64> {
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") {

View File

@@ -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 {

View File

@@ -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()
));
}
}
}
}

View File

@@ -42,7 +42,6 @@ pub enum Availability {
Specific { peers: Vec<String> },
}
#[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<ContentItem>,

View File

@@ -560,12 +560,15 @@ pub fn spawn_health_monitor(state: Arc<StateManager>, 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);

View File

@@ -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;

View File

@@ -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<Self> {
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
}
}

View File

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

View File

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