Make clippy a bit happier

This commit is contained in:
Emil Ernerfeldt
2021-02-04 13:11:04 +01:00
parent 88cde90425
commit 85bc81d4fc
15 changed files with 48 additions and 33 deletions

View File

@@ -84,7 +84,7 @@ impl PrismaticVelocityConstraint {
// .into_inner();
// #[cfg(feature = "dim3")]
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;
@@ -380,7 +380,7 @@ impl PrismaticVelocityGroundConstraint {
// .into_inner();
// #[cfg(feature = "dim3")]
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;

View File

@@ -124,7 +124,7 @@ impl WPrismaticVelocityConstraint {
// .into_inner();
// #[cfg(feature = "dim3")]
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;
@@ -483,7 +483,7 @@ impl WPrismaticVelocityGroundConstraint {
// .into_inner();
// #[cfg(feature = "dim3")]
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;

View File

@@ -56,7 +56,7 @@ impl RevolutePositionConstraint {
let axis1 = position1 * self.local_axis1;
let axis2 = position2 * self.local_axis2;
let delta_rot =
Rotation::rotation_between_axis(&axis1, &axis2).unwrap_or(Rotation::identity());
Rotation::rotation_between_axis(&axis1, &axis2).unwrap_or_else(Rotation::identity);
let ang_error = delta_rot.scaled_axis() * params.joint_erp;
let ang_impulse = self.ang_inv_lhs.transform_vector(ang_error);
@@ -129,7 +129,7 @@ impl RevolutePositionGroundConstraint {
let delta_rot =
Rotation::scaled_rotation_between_axis(&axis2, &self.axis1, params.joint_erp)
.unwrap_or(Rotation::identity());
.unwrap_or_else(Rotation::identity);
position2.rotation = delta_rot * position2.rotation;
let anchor2 = position2 * self.local_anchor2;

View File

@@ -46,7 +46,7 @@ impl RevoluteVelocityConstraint {
]);
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;
@@ -208,7 +208,7 @@ impl RevoluteVelocityGroundConstraint {
};
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = /*r21 * */ basis1;

View File

@@ -73,7 +73,7 @@ impl WRevoluteVelocityConstraint {
Matrix3x2::from_columns(&[position1 * local_basis1[0], position1 * local_basis1[1]]);
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = r21 * basis1;
@@ -290,7 +290,7 @@ impl WRevoluteVelocityGroundConstraint {
let anchor2 = position2 * local_anchor2;
// let r21 = Rotation::rotation_between_axis(&axis1, &axis2)
// .unwrap_or(Rotation::identity())
// .unwrap_or_else(Rotation::identity)
// .to_rotation_matrix()
// .into_inner();
// let basis2 = /*r21 * */ basis1;