From ffc24de9e0b01a45521e9616a797e9e3025c2913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 9 Jun 2013 12:12:18 +0000 Subject: [PATCH] Removed useless iterator usage. --- src/tests/vec.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/tests/vec.rs b/src/tests/vec.rs index 05321de8..84be3e6a 100644 --- a/src/tests/vec.rs +++ b/src/tests/vec.rs @@ -49,9 +49,7 @@ macro_rules! test_basis_impl( |(e1, e2)| { e1 == e2 || e1.dot(e2).approx_eq(&Zero::zero()) } ); // check vectors form an orthonormal basis - assert!( - do basis.iter().all |e| { e.norm().approx_eq(&One::one()) } - ); + assert!(basis.all(|e| e.norm().approx_eq(&One::one()))); } ); ) @@ -65,18 +63,14 @@ macro_rules! test_subspace_basis_impl( let subbasis = v1.orthogonal_subspace_basis(); // check vectors are orthogonal to v1 - assert!( - do subbasis.iter().all |e| { v1.dot(e).approx_eq(&Zero::zero()) } - ); + assert!(subbasis.all(|e| v1.dot(e).approx_eq(&Zero::zero()))); // check vectors form an ortogonal basis assert!( do subbasis.iter().zip(subbasis.iter()).all |(e1, e2)| { e1 == e2 || e1.dot(e2).approx_eq(&Zero::zero()) } ); // check vectors form an orthonormal basis - assert!( - do subbasis.iter().all |e| { e.norm().approx_eq(&One::one()) } - ); + assert!(subbasis.all(|e| e.norm().approx_eq(&One::one()))); } ); )