clippy: fix redundant_closure warnings

This commit is contained in:
Philippe Renon 2020-11-16 15:20:33 +01:00
parent 726b8eeecf
commit f515cffad9
2 changed files with 7 additions and 10 deletions

View File

@ -520,16 +520,13 @@ where
let v = self.vector(); let v = self.vector();
let nn = v.norm_squared(); let nn = v.norm_squared();
let le = nn.simd_le(eps * eps); let le = nn.simd_le(eps * eps);
le.if_else( le.if_else(Self::identity, || {
|| Self::identity(),
|| {
let w_exp = self.scalar().simd_exp(); let w_exp = self.scalar().simd_exp();
let n = nn.simd_sqrt(); let n = nn.simd_sqrt();
let nv = v * (w_exp * n.simd_sin() / n); 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. /// Raise the quaternion to a given floating power.

View File

@ -453,7 +453,7 @@ where
sqz + (N::one() - sqz) * cos, sqz + (N::one() - sqz) * cos,
)) ))
}, },
|| Self::identity(), Self::identity,
) )
} }