diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index 9f4d7708eec31..801ce2c0329b6 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -34,7 +34,7 @@ impl_reflect_value!(String(Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(Option Deserialize<'de> + Reflect + 'static>(Serialize, Deserialize)); impl_reflect_value!(HashSet Deserialize<'de> + Send + Sync + 'static>(Serialize, Deserialize)); impl_reflect_value!(Range Deserialize<'de> + Send + Sync + 'static>(Serialize, Deserialize)); -impl_reflect_value!(Duration); +impl_reflect_value!(Duration(Hash, PartialEq, Serialize, Deserialize)); impl_from_reflect_value!(bool); impl_from_reflect_value!(u8); @@ -364,3 +364,13 @@ impl FromReflect for Cow<'static, str> { Some(reflect.any().downcast_ref::>()?.clone()) } } + +#[cfg(test)] +mod tests { + use crate::Reflect; + + #[test] + fn can_serialize_duration() { + assert!(std::time::Duration::ZERO.serializable().is_some()) + } +}