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));