From d18f2168e4889afeb5bb51b4b5f4ca542840f82a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 14 Oct 2023 15:41:59 -0700 Subject: [PATCH] fix tests --- src/physics.rs | 5 +++++ src/worker.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/physics.rs b/src/physics.rs index 1c6422b..005ab00 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -418,6 +418,11 @@ impl Body { self.time=time; } } +impl std::fmt::Display for Body{ + fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ + write!(f,"p({}) v({}) a({}) t({})",self.position,self.velocity,self.acceleration,self.time) + } +} impl Default for PhysicsState{ fn default() -> Self { diff --git a/src/worker.rs b/src/worker.rs index 1626dad..863c982 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -100,7 +100,7 @@ fn test_worker() { }; worker.send(task).unwrap(); - println!("value={:?}",worker.grab_clone()); + println!("value={}",worker.grab_clone()); // wait long enough to see print from final task thread::sleep(std::time::Duration::from_secs(1));