mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +00:00
361686a09c
# Objective Comparing two reflected floating points would always fail: ```rust let a: &dyn Reflect = &1.23_f32; let b: &dyn Reflect = &1.23_f32; // Panics: assert!(a.reflect_partial_eq(b).unwrap_or_default()); ``` The comparison returns `None` since `f32` (and `f64`) does not have a reflected `PartialEq` implementation. ## Solution Include `PartialEq` in the `impl_reflect_value!` macro call for both `f32` and `f64`. `Hash` is still excluded since neither implement `Hash`. Also added equality tests for some of the common types from `std` (including `f32`). |
||
---|---|---|
.. | ||
impls | ||
serde | ||
lib.rs | ||
list.rs | ||
map.rs | ||
path.rs | ||
reflect.rs | ||
struct_trait.rs | ||
tuple.rs | ||
tuple_struct.rs | ||
type_registry.rs | ||
type_uuid.rs |