From 34ceea0921fb3f6c2f426af3826ebcf8241e987e Mon Sep 17 00:00:00 2001 From: John Lewis Date: Wed, 17 Jan 2024 21:31:26 -0600 Subject: [PATCH] add reflection for wrapping/saturating types --- crates/bevy_reflect/src/impls/std.rs | 2 ++ crates/bevy_reflect/src/type_uuid_impl.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index de42d0ca3fce0..9c9493516a5cc 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -201,6 +201,8 @@ impl_reflect_value!(::core::num::NonZeroI8( Serialize, Deserialize )); +impl_reflect_value!(::core::num::Wrapping()); +impl_reflect_value!(::core::num::Saturating()); impl_reflect_value!(::std::sync::Arc); // `Serialize` and `Deserialize` only for platforms supported by serde: diff --git a/crates/bevy_reflect/src/type_uuid_impl.rs b/crates/bevy_reflect/src/type_uuid_impl.rs index 9e614171ef57f..d7f772438631c 100644 --- a/crates/bevy_reflect/src/type_uuid_impl.rs +++ b/crates/bevy_reflect/src/type_uuid_impl.rs @@ -11,7 +11,7 @@ use std::ffi::OsString; use std::{ num::{ NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, - NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, + NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, Saturating, Wrapping, }, ops::{RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive}, path::PathBuf, @@ -69,6 +69,8 @@ impl_type_uuid!(NonZeroI16, "8744c2ec8a10491fae40f8bafa58b30d"); impl_type_uuid!(NonZeroU16, "c7b8b60780a6495bab4fda2bdfedabcc"); impl_type_uuid!(NonZeroU8, "635ee104ef7947fb9d7f79dad47255a3"); impl_type_uuid!(NonZeroI8, "2d3f1570b7f64779826d44da5c7ba069"); +impl_type_uuid!(Saturating, "e9d7c5d5b9e94c9c9c8c8c0f5f3c5c5f"); +impl_type_uuid!(Wrapping, "d5b9e94c9c9c8c8c0f5f3c5c5fe9d7c5"); #[cfg(any(unix, windows))] impl_type_uuid!(OsString, "809e7b3c1ea240979ecd832f91eb842a"); macro_rules! impl_tuple {