diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index f678627c4a410..2bd11c035a10b 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -16,6 +16,7 @@ use std::{ }; impl_reflect_value!(bool(Hash, PartialEq, Serialize, Deserialize)); +impl_reflect_value!(char(Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(u8(Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(u16(Hash, PartialEq, Serialize, Deserialize)); impl_reflect_value!(u32(Hash, PartialEq, Serialize, Deserialize)); @@ -37,6 +38,7 @@ impl_reflect_value!(Range Deserialize<'de> + Sen impl_reflect_value!(Duration(Hash, PartialEq, Serialize, Deserialize)); impl_from_reflect_value!(bool); +impl_from_reflect_value!(char); impl_from_reflect_value!(u8); impl_from_reflect_value!(u16); impl_from_reflect_value!(u32); @@ -552,6 +554,15 @@ mod tests { assert!(std::time::Duration::ZERO.serializable().is_some()); } + #[test] + fn should_partial_eq_char() { + let a: &dyn Reflect = &'x'; + let b: &dyn Reflect = &'x'; + let c: &dyn Reflect = &'o'; + assert!(a.reflect_partial_eq(b).unwrap_or_default()); + assert!(!a.reflect_partial_eq(c).unwrap_or_default()); + } + #[test] fn should_partial_eq_i32() { let a: &dyn Reflect = &123_i32;