From ca294a89b4b5fc67ecb3a2e270477f1c9bdb2449 Mon Sep 17 00:00:00 2001 From: Gino Valente <49806985+MrGVSV@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:29:46 -0700 Subject: [PATCH] bevy_reflect: Remove `PartialReflect::serializable` (#16576) # Objective `PartialReflect::serializable` is unused in the codebase and should be removed. I believe it originally was used to handle serializing certain types but that's no longer the case. ## Solution Remove `PartialReflect::serializable`. ## Testing You can check locally using: ``` cargo check -p bevy_reflect --all-features ``` --- ## Migration Guide `PartialReflect::serializable` has been removed. If you were using this to pass on serialization information, use `ReflectSerialize` instead or create custom type data to generate the `Serializable`. --- crates/bevy_reflect/src/func/dynamic_function.rs | 5 ----- crates/bevy_reflect/src/reflect.rs | 11 ++--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/crates/bevy_reflect/src/func/dynamic_function.rs b/crates/bevy_reflect/src/func/dynamic_function.rs index e135d23f57cd9..d513cb68084b5 100644 --- a/crates/bevy_reflect/src/func/dynamic_function.rs +++ b/crates/bevy_reflect/src/func/dynamic_function.rs @@ -8,7 +8,6 @@ use crate::{ DynamicFunctionMut, Function, FunctionOverloadError, FunctionResult, IntoFunction, IntoFunctionMut, }, - serde::Serializable, ApplyError, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, }; @@ -428,10 +427,6 @@ impl PartialReflect for DynamicFunction<'static> { Debug::fmt(self, f) } - fn serializable(&self) -> Option { - None - } - fn is_dynamic(&self) -> bool { true } diff --git a/crates/bevy_reflect/src/reflect.rs b/crates/bevy_reflect/src/reflect.rs index 2bc12e066278e..bf7844dbde91b 100644 --- a/crates/bevy_reflect/src/reflect.rs +++ b/crates/bevy_reflect/src/reflect.rs @@ -1,6 +1,6 @@ use crate::{ - array_debug, enum_debug, list_debug, map_debug, serde::Serializable, set_debug, struct_debug, - tuple_debug, tuple_struct_debug, DynamicTypePath, DynamicTyped, OpaqueInfo, ReflectKind, + array_debug, enum_debug, list_debug, map_debug, set_debug, struct_debug, tuple_debug, + tuple_struct_debug, DynamicTypePath, DynamicTyped, OpaqueInfo, ReflectKind, ReflectKindMismatchError, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, Typed, }; use alloc::boxed::Box; @@ -270,13 +270,6 @@ where } } - /// Returns a serializable version of the value. - /// - /// If the underlying type does not support serialization, returns `None`. - fn serializable(&self) -> Option { - None - } - /// Indicates whether or not this type is a _dynamic_ type. /// /// Dynamic types include the ones built-in to this [crate],