[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:
@@ -10,8 +10,8 @@ pub mod rig;
|
|||||||
|
|
||||||
pub type DynResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync>>;
|
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::command::RigCommand;
|
||||||
pub use rig::request::RigRequest;
|
pub use rig::request::RigRequest;
|
||||||
pub use rig::response::{RigError, RigResult};
|
pub use rig::response::{RigError, RigResult};
|
||||||
pub use rig::state::{RigFilterState, RigMode, RigSnapshot, RigState};
|
pub use rig::state::{RigFilterState, RigMode, RigSnapshot, RigState};
|
||||||
|
pub use rig::AudioSource;
|
||||||
|
|||||||
@@ -121,28 +121,34 @@ pub trait RigCat: Rig + Send {
|
|||||||
|
|
||||||
fn unlock<'a>(&'a mut self) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>>;
|
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>(
|
fn set_bandwidth<'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
_bandwidth_hz: u32,
|
_bandwidth_hz: u32,
|
||||||
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
||||||
Box::pin(std::future::ready(Err(Box::new(
|
Box::pin(std::future::ready(Err(
|
||||||
response::RigError::not_supported("set_bandwidth"),
|
Box::new(response::RigError::not_supported("set_bandwidth"))
|
||||||
) as Box<dyn std::error::Error + Send + Sync>)))
|
as Box<dyn std::error::Error + Send + Sync>,
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_fir_taps<'a>(
|
fn set_fir_taps<'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
_taps: u32,
|
_taps: u32,
|
||||||
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
||||||
Box::pin(std::future::ready(Err(Box::new(
|
Box::pin(std::future::ready(Err(
|
||||||
response::RigError::not_supported("set_fir_taps"),
|
Box::new(response::RigError::not_supported("set_fir_taps"))
|
||||||
) as Box<dyn std::error::Error + Send + Sync>)))
|
as Box<dyn std::error::Error + Send + Sync>,
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the current filter state if this backend supports filter controls.
|
/// 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.
|
/// Snapshot of a rig's status that every backend can expose.
|
||||||
|
|||||||
Reference in New Issue
Block a user