Skip to content

Commit

Permalink
Fix clippy (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz authored Feb 24, 2025
1 parent 5ca6ae9 commit 955795d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/control/character_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,8 @@ mod test {
);
let character_body = bodies.get_mut(handle).unwrap();
let translation = character_body.translation();
assert_eq!(
effective_movement.grounded, true,
assert!(
effective_movement.grounded,
"movement should be grounded at all times for current setup (iter: {}), pos: {}.",
i, translation + effective_movement.translation
);
Expand Down Expand Up @@ -1168,8 +1168,8 @@ mod test {
);
let character_body = bodies.get_mut(handle).unwrap();
let translation = character_body.translation();
assert_eq!(
effective_movement.grounded, true,
assert!(
effective_movement.grounded,
"movement should be grounded at all times for current setup (iter: {}), pos: {}.",
i, translation + effective_movement.translation
);
Expand Down
22 changes: 12 additions & 10 deletions src/geometry/narrow_phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,11 +1268,12 @@ mod test {
.contact_pair(collider_1_handle, collider_2_handle)
.expect("The contact pair should exist.");
assert_eq!(contact_pair.manifolds.len(), 0);
assert!(matches!(
narrow_phase.intersection_pair(collider_1_handle, collider_2_handle),
// Interaction pair is for sensors
None,
));
assert!(
narrow_phase
.intersection_pair(collider_1_handle, collider_2_handle)
.is_none(),
"Interaction pair is for sensors"
);
/* Parent collider 2 to body 2. */
collider_set.set_parent(collider_2_handle, Some(body_2_handle), &mut rigid_body_set);

Expand All @@ -1296,11 +1297,12 @@ mod test {
.contact_pair(collider_1_handle, collider_2_handle)
.expect("The contact pair should exist.");
assert_eq!(contact_pair.manifolds.len(), 1);
assert!(matches!(
narrow_phase.intersection_pair(collider_1_handle, collider_2_handle),
// Interaction pair is for sensors
None,
));
assert!(
narrow_phase
.intersection_pair(collider_1_handle, collider_2_handle)
.is_none(),
"Interaction pair is for sensors"
);

/* Run the game loop, stepping the simulation once per frame. */
for _ in 0..200 {
Expand Down

0 comments on commit 955795d

Please sign in to comment.