Fix clippy (#800)

This commit is contained in:
Thierry Berger
2025-02-24 11:34:46 +01:00
committed by GitHub
parent 5ca6ae9106
commit 955795dfbb
2 changed files with 16 additions and 14 deletions

View File

@@ -1041,8 +1041,8 @@ mod test {
); );
let character_body = bodies.get_mut(handle).unwrap(); let character_body = bodies.get_mut(handle).unwrap();
let translation = character_body.translation(); let translation = character_body.translation();
assert_eq!( assert!(
effective_movement.grounded, true, effective_movement.grounded,
"movement should be grounded at all times for current setup (iter: {}), pos: {}.", "movement should be grounded at all times for current setup (iter: {}), pos: {}.",
i, translation + effective_movement.translation i, translation + effective_movement.translation
); );
@@ -1168,8 +1168,8 @@ mod test {
); );
let character_body = bodies.get_mut(handle).unwrap(); let character_body = bodies.get_mut(handle).unwrap();
let translation = character_body.translation(); let translation = character_body.translation();
assert_eq!( assert!(
effective_movement.grounded, true, effective_movement.grounded,
"movement should be grounded at all times for current setup (iter: {}), pos: {}.", "movement should be grounded at all times for current setup (iter: {}), pos: {}.",
i, translation + effective_movement.translation i, translation + effective_movement.translation
); );

View File

@@ -1268,11 +1268,12 @@ mod test {
.contact_pair(collider_1_handle, collider_2_handle) .contact_pair(collider_1_handle, collider_2_handle)
.expect("The contact pair should exist."); .expect("The contact pair should exist.");
assert_eq!(contact_pair.manifolds.len(), 0); assert_eq!(contact_pair.manifolds.len(), 0);
assert!(matches!( assert!(
narrow_phase.intersection_pair(collider_1_handle, collider_2_handle), narrow_phase
// Interaction pair is for sensors .intersection_pair(collider_1_handle, collider_2_handle)
None, .is_none(),
)); "Interaction pair is for sensors"
);
/* Parent collider 2 to body 2. */ /* Parent collider 2 to body 2. */
collider_set.set_parent(collider_2_handle, Some(body_2_handle), &mut rigid_body_set); collider_set.set_parent(collider_2_handle, Some(body_2_handle), &mut rigid_body_set);
@@ -1296,11 +1297,12 @@ mod test {
.contact_pair(collider_1_handle, collider_2_handle) .contact_pair(collider_1_handle, collider_2_handle)
.expect("The contact pair should exist."); .expect("The contact pair should exist.");
assert_eq!(contact_pair.manifolds.len(), 1); assert_eq!(contact_pair.manifolds.len(), 1);
assert!(matches!( assert!(
narrow_phase.intersection_pair(collider_1_handle, collider_2_handle), narrow_phase
// Interaction pair is for sensors .intersection_pair(collider_1_handle, collider_2_handle)
None, .is_none(),
)); "Interaction pair is for sensors"
);
/* Run the game loop, stepping the simulation once per frame. */ /* Run the game loop, stepping the simulation once per frame. */
for _ in 0..200 { for _ in 0..200 {