From 807fbcfa2b40966487eb403a0d3e88dd250efc1e Mon Sep 17 00:00:00 2001 From: targrub Date: Tue, 20 Sep 2022 08:56:18 -0400 Subject: [PATCH] Test serialization of Bevy's Duration, not std::time::Duration. --- crates/bevy_reflect/src/impls/std.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index 462791d32bc95..0c021ba8c4c35 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -9,7 +9,8 @@ use crate::{ use crate::utility::{GenericTypeInfoCell, NonGenericTypeInfoCell}; use bevy_reflect_derive::{impl_from_reflect_value, impl_reflect_value}; -use bevy_utils::{Duration, HashMap, HashSet, Instant}; +use bevy_utils::{Duration, Instant}; +use bevy_utils::{HashMap, HashSet}; use std::{ any::Any, borrow::Cow, @@ -889,18 +890,19 @@ mod tests { Enum, FromReflect, Reflect, ReflectSerialize, TypeInfo, TypeRegistry, Typed, VariantInfo, VariantType, }; - use bevy_utils::{HashMap, Instant}; + use bevy_utils::HashMap; + use bevy_utils::{Duration, Instant}; use std::f32::consts::{PI, TAU}; #[test] fn can_serialize_duration() { let mut type_registry = TypeRegistry::default(); - type_registry.register::(); + type_registry.register::(); let reflect_serialize = type_registry - .get_type_data::(std::any::TypeId::of::()) + .get_type_data::(std::any::TypeId::of::()) .unwrap(); - let _serializable = reflect_serialize.get_serializable(&std::time::Duration::ZERO); + let _serializable = reflect_serialize.get_serializable(&Duration::ZERO); } #[test]