From da92e5c2837b27433286cf0dd9d887fd44dda254 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sat, 27 Jan 2024 16:49:53 +0100 Subject: Fix clippy and enable clippy on CI --- src_testbed/physics/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src_testbed/physics') diff --git a/src_testbed/physics/mod.rs b/src_testbed/physics/mod.rs index 60214da..26a55c7 100644 --- a/src_testbed/physics/mod.rs +++ b/src_testbed/physics/mod.rs @@ -86,6 +86,12 @@ pub struct PhysicsState { pub hooks: Box, } +impl Default for PhysicsState { + fn default() -> Self { + Self::new() + } +} + impl PhysicsState { pub fn new() -> Self { Self { @@ -113,7 +119,7 @@ pub struct PhysicsEvents { impl PhysicsEvents { pub fn poll_all(&self) { - while let Ok(_) = self.collision_events.try_recv() {} - while let Ok(_) = self.contact_force_events.try_recv() {} + while self.collision_events.try_recv().is_ok() {} + while self.contact_force_events.try_recv().is_ok() {} } } -- cgit