From 12d5945d811062cfa06b83cc4d51b8962d0646a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 18 Dec 2020 15:46:21 +0100 Subject: [PATCH] dsp/testing: simplify --- dsp/src/testing.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dsp/src/testing.rs b/dsp/src/testing.rs index 098ec87..4a14f22 100644 --- a/dsp/src/testing.rs +++ b/dsp/src/testing.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] use super::Complex; pub fn isclose(a: f64, b: f64, rtol: f64, atol: f64) -> bool { @@ -23,9 +24,7 @@ pub fn complex_allclose( rtol: f32, atol: f32, ) -> bool { - let mut result: bool = true; - a.iter().zip(b.iter()).for_each(|(i, j)| { - result &= complex_isclose(*i, *j, rtol, atol); - }); - result + a.iter() + .zip(b) + .all(|(&i, &j)| complex_isclose(i, j, rtol, atol)) }