From f515cffad96ea338edc3ee88f93b43e87e79bb4a Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Mon, 16 Nov 2020 15:20:33 +0100 Subject: [PATCH] clippy: fix redundant_closure warnings --- src/geometry/quaternion.rs | 15 ++++++--------- src/geometry/rotation_specialization.rs | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 8c4537dc..3d2e6d0d 100755 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -520,16 +520,13 @@ where let v = self.vector(); let nn = v.norm_squared(); let le = nn.simd_le(eps * eps); - le.if_else( - || Self::identity(), - || { - let w_exp = self.scalar().simd_exp(); - let n = nn.simd_sqrt(); - let nv = v * (w_exp * n.simd_sin() / n); + le.if_else(Self::identity, || { + let w_exp = self.scalar().simd_exp(); + let n = nn.simd_sqrt(); + let nv = v * (w_exp * n.simd_sin() / n); - Self::from_parts(w_exp * n.simd_cos(), nv) - }, - ) + Self::from_parts(w_exp * n.simd_cos(), nv) + }) } /// Raise the quaternion to a given floating power. diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 11b63cde..5cb7cb33 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -453,7 +453,7 @@ where sqz + (N::one() - sqz) * cos, )) }, - || Self::identity(), + Self::identity, ) }