From d659747fa47d2da346e3c7110d643f2eeff65500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Violeta=20Hern=C3=A1ndez?= Date: Fri, 18 Jun 2021 12:53:38 -0500 Subject: [PATCH] =?UTF-8?q?`&self`=20=E2=86=92=20`self`=20on=20`Copy`=20ty?= =?UTF-8?q?pes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/geometry/dual_quaternion.rs | 6 +++--- src/geometry/orthographic.rs | 4 ++-- src/geometry/perspective.rs | 4 ++-- src/geometry/quaternion.rs | 6 +++--- src/geometry/rotation_specialization.rs | 2 +- src/geometry/unit_complex.rs | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index 63148836..6e1e6cb9 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -275,7 +275,7 @@ where } impl DualQuaternion { - fn to_vector(&self) -> OVector { + fn to_vector(self) -> OVector { (*self.as_ref()).into() } } @@ -724,7 +724,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_isometry(&self) -> Isometry3 { + pub fn to_isometry(self) -> Isometry3 { Isometry3::from_parts(self.translation(), self.rotation()) } @@ -875,7 +875,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_homogeneous(&self) -> Matrix4 { + pub fn to_homogeneous(self) -> Matrix4 { self.to_isometry().to_homogeneous() } } diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index 17a5b969..7a151f8c 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -222,7 +222,7 @@ impl Orthographic3 { /// ``` #[inline] #[must_use] - pub fn to_homogeneous(&self) -> Matrix4 { + pub fn to_homogeneous(self) -> Matrix4 { self.matrix } @@ -270,7 +270,7 @@ impl Orthographic3 { /// ``` #[inline] #[must_use] - pub fn to_projective(&self) -> Projective3 { + pub fn to_projective(self) -> Projective3 { Projective3::from_matrix_unchecked(self.matrix) } diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index 6ad9707f..ae6d97b2 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -124,7 +124,7 @@ impl Perspective3 { /// Computes the corresponding homogeneous matrix. #[inline] #[must_use] - pub fn to_homogeneous(&self) -> Matrix4 { + pub fn to_homogeneous(self) -> Matrix4 { self.matrix.clone_owned() } @@ -145,7 +145,7 @@ impl Perspective3 { /// This transformation seen as a `Projective3`. #[inline] #[must_use] - pub fn to_projective(&self) -> Projective3 { + pub fn to_projective(self) -> Projective3 { Projective3::from_matrix_unchecked(self.matrix) } diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 79fda90a..8523dcfa 100755 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -1478,7 +1478,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_rotation_matrix(&self) -> Rotation { + pub fn to_rotation_matrix(self) -> Rotation { let i = self.as_ref()[0]; let j = self.as_ref()[1]; let k = self.as_ref()[2]; @@ -1513,7 +1513,7 @@ where /// The angles are produced in the form (roll, pitch, yaw). #[inline] #[deprecated(note = "This is renamed to use `.euler_angles()`.")] - pub fn to_euler_angles(&self) -> (T, T, T) + pub fn to_euler_angles(self) -> (T, T, T) where T: RealField, { @@ -1561,7 +1561,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_homogeneous(&self) -> Matrix4 { + pub fn to_homogeneous(self) -> Matrix4 { self.to_rotation_matrix().to_homogeneous() } diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 6c9ecf21..cca27b7a 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -883,7 +883,7 @@ impl Rotation3 { /// /// The angles are produced in the form (roll, pitch, yaw). #[deprecated(note = "This is renamed to use `.euler_angles()`.")] - pub fn to_euler_angles(&self) -> (T, T, T) + pub fn to_euler_angles(self) -> (T, T, T) where T: RealField, { diff --git a/src/geometry/unit_complex.rs b/src/geometry/unit_complex.rs index be0c8980..d6a7316c 100755 --- a/src/geometry/unit_complex.rs +++ b/src/geometry/unit_complex.rs @@ -261,7 +261,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_rotation_matrix(&self) -> Rotation2 { + pub fn to_rotation_matrix(self) -> Rotation2 { let r = self.re; let i = self.im; @@ -282,7 +282,7 @@ where /// ``` #[inline] #[must_use] - pub fn to_homogeneous(&self) -> Matrix3 { + pub fn to_homogeneous(self) -> Matrix3 { self.to_rotation_matrix().to_homogeneous() } }