From 24546dce2ba692a349509a5625d9e2c4b7e3ee01 Mon Sep 17 00:00:00 2001 From: forkwright Date: Thu, 21 May 2026 23:17:57 +0000 Subject: [PATCH] fix(archon): replace production unwraps Replaces the two production unwraps identified in harmonia#235 with panic-free control flow and socket address construction. Gate-Blocked: cargo +1.94 check -p archon fails in baseline paroche kosync LowerHex error before archon validation --- crates/archon/src/migrate.rs | 4 ++-- crates/archon/src/render/runner.rs | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/archon/src/migrate.rs b/crates/archon/src/migrate.rs index 83c39bf5..e57c4a25 100644 --- a/crates/archon/src/migrate.rs +++ b/crates/archon/src/migrate.rs @@ -472,8 +472,8 @@ fn parse_track_stem(stem: &str) -> (Option, String) { let mut chars = stem.chars().peekable(); let mut num_str = String::new(); - while chars.peek().is_some_and(|c| c.is_ascii_digit()) { - num_str.push(chars.next().unwrap()); + while let Some(c) = chars.next_if(|c| c.is_ascii_digit()) { + num_str.push(c); } if !num_str.is_empty() { diff --git a/crates/archon/src/render/runner.rs b/crates/archon/src/render/runner.rs index 8aea5b95..202b580a 100644 --- a/crates/archon/src/render/runner.rs +++ b/crates/archon/src/render/runner.rs @@ -160,12 +160,13 @@ async fn connect_and_run( dsp_rx: watch::Receiver, shutdown: CancellationToken, ) -> Result<(), RenderError> { - let mut endpoint = quinn::Endpoint::client("0.0.0.0:0".parse().unwrap()).map_err(|e| { - RenderError::Connection { - message: e.to_string(), - location: snafu::location!(), - } - })?; + let mut endpoint = + quinn::Endpoint::client(SocketAddr::from(([0, 0, 0, 0], 0))).map_err(|e| { + RenderError::Connection { + message: e.to_string(), + location: snafu::location!(), + } + })?; endpoint.set_default_client_config(client_config.clone()); info!(server = %server_addr, "connecting");