bevy/crates/bevy_reflect/src/impls
MrGVSV 361686a09c bevy_reflect: Added PartialEq to reflected f32 & f64 (#4217)
# 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`).
2022-04-26 19:41:26 +00:00
..
glam.rs Add Reflect support for DMat3, DMat4, DQuat (#4128) 2022-03-08 00:14:21 +00:00
smallvec.rs bevy_reflect: Add as_reflect and as_reflect_mut (#4350) 2022-04-25 13:54:48 +00:00
std.rs bevy_reflect: Added PartialEq to reflected f32 & f64 (#4217) 2022-04-26 19:41:26 +00:00