diff --git a/gdnative-core/src/core_types/geom/basis.rs b/gdnative-core/src/core_types/geom/basis.rs index 5550c102a..5f8fe3854 100644 --- a/gdnative-core/src/core_types/geom/basis.rs +++ b/gdnative-core/src/core_types/geom/basis.rs @@ -670,7 +670,7 @@ mod tests { fn euler() { let (_b, bn) = test_inputs(); - dbg!(bn.to_euler()); + dbg!(bn.to_euler()); assert!(Vector3::new(0.57079, 0.310283, 0.760213).is_equal_approx(bn.to_euler())); } @@ -696,7 +696,10 @@ mod tests { Vector3::new(0.012407, -0.040492, -0.007774), Vector3::new(-0.682131, -0.212475, 0.018051), ]); - dbg!(expected, b.scaled(&Vector3::new(0.677813, -0.043058, 0.714685))); + dbg!( + expected, + b.scaled(&Vector3::new(0.677813, -0.043058, 0.714685)) + ); assert!(expected.is_equal_approx(&b.scaled(&Vector3::new(0.677813, -0.043058, 0.714685)))); } @@ -718,7 +721,7 @@ mod tests { fn to_quat() { let (b, _bn) = test_inputs(); - dbg!(b.to_quat()); + dbg!(b.to_quat()); assert!(Quat::new(-0.167156, 0.677813, -0.043058, 0.714685).is_equal_approx(&b.to_quat())); } @@ -751,7 +754,7 @@ mod tests { fn xform() { let (b, _bn) = test_inputs(); - dbg!(b.xform(Vector3::new(0.5, 0.7, -0.2))); + dbg!(b.xform(Vector3::new(0.5, 0.7, -0.2))); assert!(Vector3::new(-0.273471, 0.478102, -0.690386) .is_equal_approx(b.xform(Vector3::new(0.5, 0.7, -0.2)))); } @@ -760,7 +763,7 @@ mod tests { fn xform_inv() { let (b, _bn) = test_inputs(); - dbg!(b.xform(Vector3::new(0.077431, -0.165055, 0.98324))); + dbg!(b.xform(Vector3::new(0.077431, -0.165055, 0.98324))); assert!(Vector3::new(-0.884898, -0.460316, 0.071165) .is_equal_approx(b.xform_inv(Vector3::new(0.077431, -0.165055, 0.98324)))); } @@ -774,7 +777,7 @@ mod tests { Vector3::new(-0.165055, 0.94041, -0.297299), Vector3::new(0.98324, 0.180557, 0.025257), ]); - dbg!(b.inverted(), expected); + dbg!(b.inverted(), expected); assert!(expected.is_equal_approx(&b.inverted())); } } diff --git a/gdnative-core/src/core_types/geom/plane.rs b/gdnative-core/src/core_types/geom/plane.rs index 191a07703..07268b2ce 100644 --- a/gdnative-core/src/core_types/geom/plane.rs +++ b/gdnative-core/src/core_types/geom/plane.rs @@ -192,7 +192,7 @@ mod test { let expected_valid = Plane::from_coordinates(0.447214, 0.0, -0.894427, -0.447214); - dbg!(expected_valid); + dbg!(expected_valid); assert!(Plane::from_points(a, b, c) .unwrap() .is_equal_approx(expected_valid)); @@ -240,8 +240,8 @@ mod test { let d = Plane::from_coordinates(0.01, 0.02, 0.4, 0.16); let e = Plane::from_coordinates(0.01, 0.02, 0.4, 0.32); - dbg!(p.intersect_3(b, c)); - dbg!(expected); + dbg!(p.intersect_3(b, c)); + dbg!(expected); assert!(p.intersect_3(b, c).unwrap().is_equal_approx(expected)); assert_eq!(p.intersect_3(d, e), None); } @@ -287,7 +287,7 @@ mod test { fn normalize() { let (p, _v) = test_inputs(); - dbg!(p.normalize()); + dbg!(p.normalize()); assert!(p.normalize().is_equal_approx(Plane::from_coordinates( 0.218218, 0.436436, 0.872872, 1.745743 ))); diff --git a/gdnative-core/src/core_types/mod.rs b/gdnative-core/src/core_types/mod.rs index b7bdb6dfc..3216b909f 100644 --- a/gdnative-core/src/core_types/mod.rs +++ b/gdnative-core/src/core_types/mod.rs @@ -22,9 +22,9 @@ mod vector2; mod vector2_array; mod vector3_array; +pub mod dictionary; pub mod error; pub mod vector3; -pub mod dictionary; pub use geom::*; diff --git a/gdnative-core/src/core_types/vector3.rs b/gdnative-core/src/core_types/vector3.rs index eef333877..661d9d8fc 100644 --- a/gdnative-core/src/core_types/vector3.rs +++ b/gdnative-core/src/core_types/vector3.rs @@ -184,7 +184,7 @@ impl Vector3 { /// Returns the axis of the vector's largest value. See `Axis` enum. /// If all components are equal, this method returns `Axis::X`. #[inline] - #[allow(clippy::collapsible-if)] + #[allow(clippy::collapsible_if)] pub fn max_axis(self) -> Axis { if self.z > self.y { if self.z > self.x { @@ -204,7 +204,7 @@ impl Vector3 { /// Returns the axis of the vector's smallest value. See `Axis` enum. /// If all components are equal, this method returns `Axis::Z`. #[inline] - #[allow(clippy::collapsible-if)] + #[allow(clippy::collapsible_if)] pub fn min_axis(self) -> Axis { if self.x < self.y { if self.x < self.z { @@ -374,6 +374,7 @@ impl Vector3 { } impl AsRef<[f32; 3]> for Vector3 { + #[inline] fn as_ref(&self) -> &[f32; 3] { // SAFETY: Vector3 is repr(C) unsafe { &*(self as *const Vector3 as *const [f32; 3]) } @@ -410,7 +411,7 @@ macro_rules! derive_op_impl_rev { #[inline] fn $func(self, with: Self::Output) -> Self::Output { - with * self + $trait::$func(with, self) } } };