Skip to content

Commit 03950dc

Browse files
committed
Fix clippy warnings
Replace the manual modulo checks with is_multiple_of, which recent clippy versions flag, and allow the argument count of new_with_sinc_interpolator now that it also takes the filter cutoff. CI runs clippy with -D warnings, so both were fatal.
1 parent c4488b7 commit 03950dc

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/asynchro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ where
335335
/// - `chunk_size`: Size of output data in frames.
336336
/// - `nbr_channels`: Number of channels in input/output.
337337
#[cfg_attr(feature = "bench_asyncro", visibility::make(pub))]
338+
#[allow(clippy::too_many_arguments)]
338339
fn new_with_sinc_interpolator(
339340
resample_ratio: f64,
340341
max_resample_ratio_relative: f64,

src/sinc_interpolator/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ where
277277
f_cutoff: f32,
278278
window: WindowFunction,
279279
) -> Self {
280-
assert!(sinc_len % 8 == 0, "Sinc length must be a multiple of 8");
280+
assert!(
281+
sinc_len.is_multiple_of(8),
282+
"Sinc length must be a multiple of 8"
283+
);
281284
let raw_sincs: Vec<Vec<T>> = make_sincs(sinc_len, oversampling_factor, f_cutoff, window);
282285
let sincs = raw_sincs
283286
.into_iter()

src/sinc_interpolator/sinc_interpolator_avx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ where
264264
return Err(MissingCpuFeature(*feature));
265265
}
266266

267-
assert!(sinc_len % 8 == 0, "Sinc length must be a multiple of 8.");
267+
assert!(sinc_len.is_multiple_of(8), "Sinc length must be a multiple of 8.");
268268
let raw_sincs: Vec<Vec<T>> = make_sincs(sinc_len, oversampling_factor, f_cutoff, window);
269269
let sincs = raw_sincs
270270
.into_iter()

src/sinc_interpolator/sinc_interpolator_neon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ where
267267
return Err(MissingCpuFeature(*feature));
268268
}
269269

270-
assert!(sinc_len % 8 == 0, "Sinc length must be a multiple of 8.");
270+
assert!(sinc_len.is_multiple_of(8), "Sinc length must be a multiple of 8.");
271271
let raw_sincs: Vec<Vec<T>> = make_sincs(sinc_len, oversampling_factor, f_cutoff, window);
272272
let sincs = raw_sincs
273273
.into_iter()

src/sinc_interpolator/sinc_interpolator_sse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ where
264264
return Err(MissingCpuFeature(*feature));
265265
}
266266

267-
assert!(sinc_len % 8 == 0, "Sinc length must be a multiple of 8.");
267+
assert!(sinc_len.is_multiple_of(8), "Sinc length must be a multiple of 8.");
268268
let raw_sincs: Vec<Vec<T>> = make_sincs(sinc_len, oversampling_factor, f_cutoff, window);
269269
let sincs = raw_sincs
270270
.into_iter()

0 commit comments

Comments
 (0)