Skip to content

Commit bc31604

Browse files
committed
Make IIRNode panic message dynamic
1 parent 77f31af commit bc31604

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/node/iir_filter.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const MAX_IIR_COEFFS_LEN: usize = 20;
2525
fn assert_valid_feedforward_coefs(coefs: &Vec<f64>) {
2626
assert!(
2727
!coefs.is_empty() && coefs.len() <= MAX_IIR_COEFFS_LEN,
28-
"NotSupportedError - IIR Filter feedforward coefficients should have length >= 0 and <= 20"
28+
"NotSupportedError - IIR Filter feedforward coefficients should have length >= 0 and <= {}",
29+
MAX_IIR_COEFFS_LEN,
2930
);
3031

3132
assert!(
@@ -48,7 +49,8 @@ fn assert_valid_feedforward_coefs(coefs: &Vec<f64>) {
4849
fn assert_valid_feedback_coefs(coefs: &Vec<f64>) {
4950
assert!(
5051
!coefs.is_empty() && coefs.len() <= MAX_IIR_COEFFS_LEN,
51-
"NotSupportedError - IIR Filter feedback coefficients should have length >= 0 and <= 20"
52+
"NotSupportedError - IIR Filter feedback coefficients should have length >= 0 and <= {}",
53+
MAX_IIR_COEFFS_LEN,
5254
);
5355

5456
assert_ne!(

0 commit comments

Comments
 (0)