From 4d9c451de8ac05098da13f2cf750495213e18bba Mon Sep 17 00:00:00 2001 From: DasLixou Date: Wed, 21 Aug 2024 15:24:44 +0200 Subject: [PATCH] Fix type shenanigans --- crates/blenvy/src/components/fake_entity.rs | 14 +++++++++++--- .../components/ronstring_to_reflect_component.rs | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/crates/blenvy/src/components/fake_entity.rs b/crates/blenvy/src/components/fake_entity.rs index 93aa070..0ff7214 100644 --- a/crates/blenvy/src/components/fake_entity.rs +++ b/crates/blenvy/src/components/fake_entity.rs @@ -124,15 +124,23 @@ const _: () = { } #[inline] fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self + // this is changed + unsafe { + core::mem::transmute::< + ::std::boxed::Box, + ::std::boxed::Box, + >(self) + } } #[inline] fn as_any(&self) -> &dyn ::core::any::Any { - self + // this is changed + unsafe { core::mem::transmute::<&Entity, &bevy::ecs::entity::Entity>(self) } } #[inline] fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any { - self + // this is changed + unsafe { core::mem::transmute::<&mut Entity, &mut bevy::ecs::entity::Entity>(self) } } #[inline] fn into_reflect( diff --git a/crates/blenvy/src/components/ronstring_to_reflect_component.rs b/crates/blenvy/src/components/ronstring_to_reflect_component.rs index ba1a473..f23c38a 100644 --- a/crates/blenvy/src/components/ronstring_to_reflect_component.rs +++ b/crates/blenvy/src/components/ronstring_to_reflect_component.rs @@ -1,7 +1,7 @@ use std::any::TypeId; -use bevy::log::{debug, warn}; -use bevy::reflect::serde::ReflectDeserializer; +use bevy::log::{debug, info, warn}; +use bevy::reflect::serde::{ReflectDeserializer, ReflectSerializer}; use bevy::reflect::{GetTypeRegistration, Reflect, TypeRegistration, TypeRegistry}; use bevy::utils::HashMap; use ron::Value;