Skip to content

Commit 2532447

Browse files
authored
impl Reflect for EntityHashSet (#12971)
`EntityHashSet` doesn't seem to implement `Reflect` which seems weird! Especially since `EntityHashMap` implements `Reflect`. This PR just added an extra `impl_reflect_value!` for `EntityHashSet` and this seems to do the trick. I left out doing the same for `StableHashSet` since it's marked as deprecated. --- I'm really wondering what was the issue here. If anyone can explain why `EntityHashSet` can't use the `Reflect` impl of `bevy_utils::HashSet` similar to how it's the case with the `...HashMap`s I'd be interested!
1 parent 7b8d502 commit 2532447

File tree

1 file changed

+5
-2
lines changed
  • crates/bevy_reflect/src/impls

1 file changed

+5
-2
lines changed

crates/bevy_reflect/src/impls/std.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl_reflect_value!(
102102
);
103103
impl_reflect_value!(::std::collections::BTreeSet<T: Ord + Eq + Clone + Send + Sync>());
104104
impl_reflect_value!(::std::collections::HashSet<T: Hash + Eq + Clone + Send + Sync, S: TypePath + Clone + Send + Sync>());
105-
impl_reflect_value!(::bevy_utils::HashSet<T: Hash + Eq + Clone + Send + Sync>());
105+
impl_reflect_value!(::bevy_utils::hashbrown::HashSet<T: Hash + Eq + Clone + Send + Sync, S: TypePath + Clone + Send + Sync>());
106106
impl_reflect_value!(::core::ops::Range<T: Clone + Send + Sync>());
107107
impl_reflect_value!(::core::ops::RangeInclusive<T: Clone + Send + Sync>());
108108
impl_reflect_value!(::core::ops::RangeFrom<T: Clone + Send + Sync>());
@@ -220,6 +220,10 @@ impl_reflect_value!(::std::ffi::OsString(
220220
impl_reflect_value!(::std::ffi::OsString(Debug, Hash, PartialEq));
221221
impl_reflect_value!(::alloc::collections::BinaryHeap<T: Clone>);
222222

223+
impl_type_path!(::bevy_utils::NoOpHash);
224+
impl_type_path!(::bevy_utils::EntityHash);
225+
impl_type_path!(::bevy_utils::FixedState);
226+
223227
macro_rules! impl_reflect_for_veclike {
224228
($ty:path, $insert:expr, $remove:expr, $push:expr, $pop:expr, $sub:ty) => {
225229
impl<T: FromReflect + TypePath + GetTypeRegistration> List for $ty {
@@ -629,7 +633,6 @@ impl_type_path!(::std::collections::HashMap<K, V, S>);
629633

630634
impl_reflect_for_hashmap!(bevy_utils::hashbrown::HashMap<K, V, S>);
631635
impl_type_path!(::bevy_utils::hashbrown::hash_map::DefaultHashBuilder);
632-
impl_type_path!(::bevy_utils::NoOpHash);
633636
impl_type_path!(::bevy_utils::hashbrown::HashMap<K, V, S>);
634637

635638
impl<K, V> Map for ::std::collections::BTreeMap<K, V>

0 commit comments

Comments
 (0)