[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 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 23:33:27 +01:00
parent 3cd614e6a2
commit e3626eafd4
2 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -10,8 +10,8 @@ pub mod rig;
pub type DynResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync>>;
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;
+14 -8
View File
@@ -121,28 +121,34 @@ pub trait RigCat: Rig + Send {
fn unlock<'a>(&'a mut self) -> Pin<Box<dyn Future<Output = DynResult<()>> + 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<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(Box::new(
response::RigError::not_supported("set_bandwidth"),
) as Box<dyn std::error::Error + Send + Sync>)))
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_bandwidth"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
fn set_fir_taps<'a>(
&'a mut self,
_taps: u32,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(Box::new(
response::RigError::not_supported("set_fir_taps"),
) as Box<dyn std::error::Error + Send + Sync>)))
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_fir_taps"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
/// Return the current filter state if this backend supports filter controls.
fn filter_state(&self) -> Option<state::RigFilterState> { None }
fn filter_state(&self) -> Option<state::RigFilterState> {
None
}
}
/// Snapshot of a rig's status that every backend can expose.