[fix](workspace): resolve clippy warnings

Clean up the workspace so cargo clippy passes across all targets and features.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 13:22:44 +01:00
parent 523f3992f5
commit 46bc96ddf2
10 changed files with 89 additions and 102 deletions
+1
View File
@@ -147,6 +147,7 @@ impl DummyRig {
}
#[cfg(test)]
#[allow(clippy::items_after_test_module)]
mod tests {
use super::*;
use trx_core::rig::Rig;
@@ -154,7 +154,7 @@ fn fast_atan2(y: f32, x: f32) -> f32 {
}
}
let angle = if x > 0.0 {
if x > 0.0 {
fast_atan(y / x)
} else if x < 0.0 {
if y >= 0.0 {
@@ -164,8 +164,7 @@ fn fast_atan2(y: f32, x: f32) -> f32 {
}
} else {
0.0
};
angle
}
}
/// 7th-order minimax atan approximation for |z| ≤ 1.
@@ -1511,14 +1510,14 @@ mod tests {
let pilot_freq = 19_000.0_f32;
let carrier_freq = 38_000.0_f32;
let mut composite = vec![0.0_f32; num_samples];
for n in 0..num_samples {
for (n, sample) in composite.iter_mut().enumerate() {
let t = n as f32 / fs;
let audio = (TAU * audio_freq * t).sin(); // L = audio, R = 0
let sum = audio; // L + R
let diff = audio; // L - R
let pilot = 0.1 * (TAU * pilot_freq * t).cos();
let carrier = (TAU * carrier_freq * t).cos();
composite[n] = sum + pilot + diff * carrier;
*sample = sum + pilot + diff * carrier;
}
// --- FM-modulate composite → IQ samples ---
@@ -1613,7 +1612,7 @@ mod tests {
// Test both L-only (diff = +audio) and R-only (diff = -audio).
for (label, diff_sign) in [("L-only", 1.0_f32), ("R-only", -1.0_f32)] {
let mut composite = vec![0.0_f32; num_samples];
for n in 0..num_samples {
for (n, sample) in composite.iter_mut().enumerate() {
let t = n as f32 / fs;
let audio: f32 = freqs.iter().map(|&f| (TAU * f * t).sin()).sum::<f32>()
/ freqs.len() as f32;
@@ -1621,7 +1620,7 @@ mod tests {
let diff = audio * diff_sign; // L - R
let pilot = 0.1 * (TAU * pilot_freq * t).cos();
let carrier = (TAU * carrier_freq * t).cos();
composite[n] = sum + pilot + diff * carrier;
*sample = sum + pilot + diff * carrier;
}
let peak_composite = 2.1_f32;
@@ -1928,14 +1927,14 @@ mod tests {
let pilot_freq = 19_000.0_f32;
let carrier_freq = 38_000.0_f32;
let mut composite = vec![0.0_f32; num_samples];
for n in 0..num_samples {
for (n, sample) in composite.iter_mut().enumerate() {
let t = n as f32 / fs;
let audio = (TAU * audio_freq * t).sin();
let sum = audio;
let diff = audio;
let pilot = 0.1 * (TAU * pilot_freq * t).cos();
let carrier = (TAU * carrier_freq * t).cos();
composite[n] = sum + pilot + diff * carrier;
*sample = sum + pilot + diff * carrier;
}
let peak_composite = 2.1_f32;
@@ -178,16 +178,18 @@ pub struct BlockFirFilterPair {
scratch_freq: Vec<FftComplex<f32>>,
}
fn build_fir_kernel(
cutoff_norm: f32,
taps: usize,
block_size: usize,
) -> (
type FirKernel = (
Vec<FftComplex<f32>>,
usize,
Arc<dyn Fft<f32>>,
Arc<dyn Fft<f32>>,
) {
);
fn build_fir_kernel(
cutoff_norm: f32,
taps: usize,
block_size: usize,
) -> FirKernel {
let coeffs = windowed_sinc_coeffs(cutoff_norm, taps);
let fft_size = (block_size + taps - 1).next_power_of_two();
@@ -943,6 +945,7 @@ pub struct SdrPipeline {
}
impl SdrPipeline {
#[allow(clippy::too_many_arguments)]
pub fn start(
source: Box<dyn IqSource>,
sdr_sample_rate: u32,