From f71f93c843ea03d38477353ac02e3854053e27f9 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Tue, 22 Jun 2021 16:57:48 +0000 Subject: [PATCH] Derive Clone for Time (#2360) # Objective - Make it so that `Time` can be cloned - Makes it so I can clone the entire current `Time` and easily pass it to the user in [Rusty Engine](https://github.com/CleanCut/rusty_engine) instead of [doing this](https://github.com/CleanCut/rusty_engine/blob/8302dc3914d5b14b730e994cca452ce8d252fec2/src/game.rs#L147-L150) ## Solution - Derive the `Clone` trait on `Time` --- crates/bevy_core/src/time/time.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_core/src/time/time.rs b/crates/bevy_core/src/time/time.rs index 5139ade733..1189aebe8a 100644 --- a/crates/bevy_core/src/time/time.rs +++ b/crates/bevy_core/src/time/time.rs @@ -2,7 +2,7 @@ use bevy_ecs::system::ResMut; use bevy_utils::{Duration, Instant}; /// Tracks elapsed time since the last update and since the App has started -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Time { delta: Duration, last_update: Option,