@@ -33,6 +33,7 @@ const MAX_FFT_SIZE: usize = 32768;
33
33
34
34
// [spec] This MUST be a power of two in the range 32 to 32768, otherwise an
35
35
// IndexSizeError exception MUST be thrown.
36
+ #[ allow( clippy:: manual_range_contains) ]
36
37
fn assert_valid_fft_size ( fft_size : usize ) {
37
38
assert ! (
38
39
fft_size. is_power_of_two( ) ,
@@ -41,7 +42,7 @@ fn assert_valid_fft_size(fft_size: usize) {
41
42
) ;
42
43
43
44
assert ! (
44
- ( MIN_FFT_SIZE ..= MAX_FFT_SIZE ) . contains ( & fft_size) ,
45
+ fft_size >= MIN_FFT_SIZE && fft_size <= MAX_FFT_SIZE ,
45
46
"IndexSizeError - Invalid fft size: {:?} is outside range [{:?}, {:?}]" ,
46
47
fft_size,
47
48
MIN_FFT_SIZE ,
@@ -51,9 +52,10 @@ fn assert_valid_fft_size(fft_size: usize) {
51
52
52
53
// [spec] If the value of this attribute is set to a value less than 0 or more
53
54
// than 1, an IndexSizeError exception MUST be thrown.
55
+ #[ allow( clippy:: manual_range_contains) ]
54
56
fn assert_valid_smoothing_time_constant ( smoothing_time_constant : f64 ) {
55
57
assert ! (
56
- ( 0. ..= 1. ) . contains ( & smoothing_time_constant ) ,
58
+ smoothing_time_constant >= 0. && smoothing_time_constant <= 1. ,
57
59
"IndexSizeError - Invalid smoothing time constant: {:?} is outside range [0, 1]" ,
58
60
smoothing_time_constant
59
61
) ;
0 commit comments