From e3626eafd49c8db38f6a27f3a6ea5807a306c730 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Thu, 26 Feb 2026 23:33:27 +0100 Subject: [PATCH] [style](trx-core): improve code formatting and trait readability Reformat filter state methods and error handling for better consistency. Improve readability of complex return type expressions. Co-Authored-By: Claude Opus 4.6 --- src/trx-core/src/lib.rs | 2 +- src/trx-core/src/rig/mod.rs | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/trx-core/src/lib.rs b/src/trx-core/src/lib.rs index 125c426..4bf4663 100644 --- a/src/trx-core/src/lib.rs +++ b/src/trx-core/src/lib.rs @@ -10,8 +10,8 @@ pub mod rig; pub type DynResult = Result>; -pub use rig::AudioSource; pub use rig::command::RigCommand; pub use rig::request::RigRequest; pub use rig::response::{RigError, RigResult}; pub use rig::state::{RigFilterState, RigMode, RigSnapshot, RigState}; +pub use rig::AudioSource; diff --git a/src/trx-core/src/rig/mod.rs b/src/trx-core/src/rig/mod.rs index dc24c46..9f88566 100644 --- a/src/trx-core/src/rig/mod.rs +++ b/src/trx-core/src/rig/mod.rs @@ -121,28 +121,34 @@ pub trait RigCat: Rig + Send { fn unlock<'a>(&'a mut self) -> Pin> + Send + 'a>>; - fn as_audio_source(&self) -> Option<&dyn AudioSource> { None } + fn as_audio_source(&self) -> Option<&dyn AudioSource> { + None + } fn set_bandwidth<'a>( &'a mut self, _bandwidth_hz: u32, ) -> Pin> + Send + 'a>> { - Box::pin(std::future::ready(Err(Box::new( - response::RigError::not_supported("set_bandwidth"), - ) as Box))) + Box::pin(std::future::ready(Err( + Box::new(response::RigError::not_supported("set_bandwidth")) + as Box, + ))) } fn set_fir_taps<'a>( &'a mut self, _taps: u32, ) -> Pin> + Send + 'a>> { - Box::pin(std::future::ready(Err(Box::new( - response::RigError::not_supported("set_fir_taps"), - ) as Box))) + Box::pin(std::future::ready(Err( + Box::new(response::RigError::not_supported("set_fir_taps")) + as Box, + ))) } /// Return the current filter state if this backend supports filter controls. - fn filter_state(&self) -> Option { None } + fn filter_state(&self) -> Option { + None + } } /// Snapshot of a rig's status that every backend can expose.