From 1a2ae96b6a00f91edf5f2ec2eeffa4f9041d6bcd Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Thu, 12 Feb 2026 20:39:22 +0100 Subject: [PATCH] [refactor](trx-client): use trx-app for shared infrastructure Replace client's local implementations with unified trx-app utilities. Changes: - Use trx_app::normalize_name() instead of local fn - Depend on trx-app crate This eliminates the client's copy of the normalize_name logic and ensures both server and client use the same implementation. Co-Authored-By: Claude Haiku 4.5 Signed-off-by: Stanislaw Grams --- src/trx-client/Cargo.toml | 1 + src/trx-client/src/main.rs | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/trx-client/Cargo.toml b/src/trx-client/Cargo.toml index 4b5dfe9..6726b12 100644 --- a/src/trx-client/Cargo.toml +++ b/src/trx-client/Cargo.toml @@ -18,6 +18,7 @@ clap = { workspace = true, features = ["derive"] } dirs = "6" libloading = "0.8" bytes = "1" +trx-app = { path = "../trx-app" } trx-core = { path = "../trx-core" } trx-protocol = { path = "../trx-protocol" } trx-frontend = { path = "trx-frontend" } diff --git a/src/trx-client/src/main.rs b/src/trx-client/src/main.rs index 3183b7f..c273c6b 100644 --- a/src/trx-client/src/main.rs +++ b/src/trx-client/src/main.rs @@ -17,6 +17,7 @@ use tokio::signal; use tokio::sync::{broadcast, mpsc, watch}; use tracing::info; +use trx_app::normalize_name; use trx_core::audio::AudioStreamInfo; use trx_core::rig::request::RigRequest; @@ -81,14 +82,6 @@ struct Cli { callsign: Option, } -/// Normalize a rig/frontend name to lowercase alphanumeric. -fn normalize_name(name: &str) -> String { - name.to_ascii_lowercase() - .chars() - .filter(|c| c.is_ascii_alphanumeric()) - .collect() -} - fn main() -> DynResult<()> { let rt = tokio::runtime::Runtime::new()?;