From 5dff493515d66a965242ead4c50754e758d21114 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Mon, 26 Oct 2020 13:37:11 +0100 Subject: [PATCH] clippy: fix just_underscores_and_digits warnings --- src/base/cg.rs | 38 ++++++++++++------------- src/base/unit.rs | 6 ++-- src/geometry/quaternion_construction.rs | 10 +++---- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/base/cg.rs b/src/base/cg.rs index ba319c7e..f63cca64 100644 --- a/src/base/cg.rs +++ b/src/base/cg.rs @@ -79,18 +79,18 @@ impl Matrix3 { /// Can be used to implement "zoom_to" functionality. #[inline] pub fn new_nonuniform_scaling_wrt_point(scaling: &Vector2, pt: &Point2) -> Self { - let _0 = N::zero(); - let _1 = N::one(); + let zero = N::zero(); + let one = N::one(); Matrix3::new( scaling.x, - _0, + zero, pt.x - pt.x * scaling.x, - _0, + zero, scaling.y, pt.y - pt.y * scaling.y, - _0, - _0, - _1, + zero, + zero, + one, ) } } @@ -119,25 +119,25 @@ impl Matrix4 { /// Can be used to implement "zoom_to" functionality. #[inline] pub fn new_nonuniform_scaling_wrt_point(scaling: &Vector3, pt: &Point3) -> Self { - let _0 = N::zero(); - let _1 = N::one(); + let zero = N::zero(); + let one = N::one(); Matrix4::new( scaling.x, - _0, - _0, + zero, + zero, pt.x - pt.x * scaling.x, - _0, + zero, scaling.y, - _0, + zero, pt.y - pt.y * scaling.y, - _0, - _0, + zero, + zero, scaling.z, pt.z - pt.z * scaling.z, - _0, - _0, - _0, - _1, + zero, + zero, + zero, + one, ) } diff --git a/src/base/unit.rs b/src/base/unit.rs index 9a32dd2f..5afa006b 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -134,9 +134,9 @@ impl Unit { #[inline] pub fn renormalize_fast(&mut self) { let sq_norm = self.value.norm_squared(); - let _3: T::Norm = crate::convert(3.0); - let _0_5: T::Norm = crate::convert(0.5); - self.value.scale_mut(_0_5 * (_3 - sq_norm)); + let three: T::Norm = crate::convert(3.0); + let half: T::Norm = crate::convert(0.5); + self.value.scale_mut(half * (three - sq_norm)); } } diff --git a/src/geometry/quaternion_construction.rs b/src/geometry/quaternion_construction.rs index 0c8d769f..63f00636 100644 --- a/src/geometry/quaternion_construction.rs +++ b/src/geometry/quaternion_construction.rs @@ -285,13 +285,13 @@ where // Robust matrix to quaternion transformation. // See https://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion let tr = rotmat[(0, 0)] + rotmat[(1, 1)] + rotmat[(2, 2)]; - let _0_25: N = crate::convert(0.25); + let quarter: N = crate::convert(0.25); let res = tr.simd_gt(N::zero()).if_else3( || { let denom = (tr + N::one()).simd_sqrt() * crate::convert(2.0); Quaternion::new( - _0_25 * denom, + quarter * denom, (rotmat[(2, 1)] - rotmat[(1, 2)]) / denom, (rotmat[(0, 2)] - rotmat[(2, 0)]) / denom, (rotmat[(1, 0)] - rotmat[(0, 1)]) / denom, @@ -305,7 +305,7 @@ where * crate::convert(2.0); Quaternion::new( (rotmat[(2, 1)] - rotmat[(1, 2)]) / denom, - _0_25 * denom, + quarter * denom, (rotmat[(0, 1)] + rotmat[(1, 0)]) / denom, (rotmat[(0, 2)] + rotmat[(2, 0)]) / denom, ) @@ -320,7 +320,7 @@ where Quaternion::new( (rotmat[(0, 2)] - rotmat[(2, 0)]) / denom, (rotmat[(0, 1)] + rotmat[(1, 0)]) / denom, - _0_25 * denom, + quarter * denom, (rotmat[(1, 2)] + rotmat[(2, 1)]) / denom, ) }, @@ -333,7 +333,7 @@ where (rotmat[(1, 0)] - rotmat[(0, 1)]) / denom, (rotmat[(0, 2)] + rotmat[(2, 0)]) / denom, (rotmat[(1, 2)] + rotmat[(2, 1)]) / denom, - _0_25 * denom, + quarter * denom, ) }, );