diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index 02fdcc76..83058032 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -320,7 +320,7 @@ where } impl DualQuaternion { - fn to_vector(self) -> OVector { + fn to_vector(&self) -> OVector { self.as_ref().clone().into() } } @@ -335,9 +335,9 @@ impl> AbsDiffEq for DualQuaternion { #[inline] fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool { - self.clone().to_vector().abs_diff_eq(&other.clone().to_vector(), epsilon.clone()) || + self.to_vector().abs_diff_eq(&other.to_vector(), epsilon.clone()) || // Account for the double-covering of S², i.e. q = -q - self.clone().to_vector().iter().zip(other.clone().to_vector().iter()).all(|(a, b)| a.abs_diff_eq(&-b.clone(), epsilon.clone())) + self.to_vector().iter().zip(other.to_vector().iter()).all(|(a, b)| a.abs_diff_eq(&-b.clone(), epsilon.clone())) } } @@ -354,9 +354,9 @@ impl> RelativeEq for DualQuaternion { epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool { - self.clone().to_vector().relative_eq(&other.clone().to_vector(), epsilon.clone(), max_relative.clone()) || + self.to_vector().relative_eq(&other.to_vector(), epsilon.clone(), max_relative.clone()) || // Account for the double-covering of S², i.e. q = -q - self.clone().to_vector().iter().zip(other.clone().to_vector().iter()).all(|(a, b)| a.relative_eq(&-b.clone(), epsilon.clone(), max_relative.clone())) + self.to_vector().iter().zip(other.to_vector().iter()).all(|(a, b)| a.relative_eq(&-b.clone(), epsilon.clone(), max_relative.clone())) } } @@ -368,9 +368,9 @@ impl> UlpsEq for DualQuaternion { #[inline] fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool { - self.clone().to_vector().ulps_eq(&other.clone().to_vector(), epsilon.clone(), max_ulps) || + self.to_vector().ulps_eq(&other.to_vector(), epsilon.clone(), max_ulps) || // Account for the double-covering of S², i.e. q = -q. - self.clone().to_vector().iter().zip(other.clone().to_vector().iter()).all(|(a, b)| a.ulps_eq(&-b.clone(), epsilon.clone(), max_ulps)) + self.to_vector().iter().zip(other.to_vector().iter()).all(|(a, b)| a.ulps_eq(&-b.clone(), epsilon.clone(), max_ulps)) } }