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`.
This commit is contained in:
Gino Valente 2024-12-16 16:29:46 -07:00 committed by GitHub
parent f2719f5470
commit ca294a89b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 14 deletions

View File

@ -8,7 +8,6 @@ use crate::{
DynamicFunctionMut, Function, FunctionOverloadError, FunctionResult, IntoFunction, DynamicFunctionMut, Function, FunctionOverloadError, FunctionResult, IntoFunction,
IntoFunctionMut, IntoFunctionMut,
}, },
serde::Serializable,
ApplyError, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ApplyError, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned,
ReflectRef, TypeInfo, TypePath, ReflectRef, TypeInfo, TypePath,
}; };
@ -428,10 +427,6 @@ impl PartialReflect for DynamicFunction<'static> {
Debug::fmt(self, f) Debug::fmt(self, f)
} }
fn serializable(&self) -> Option<Serializable> {
None
}
fn is_dynamic(&self) -> bool { fn is_dynamic(&self) -> bool {
true true
} }

View File

@ -1,6 +1,6 @@
use crate::{ use crate::{
array_debug, enum_debug, list_debug, map_debug, serde::Serializable, set_debug, struct_debug, array_debug, enum_debug, list_debug, map_debug, set_debug, struct_debug, tuple_debug,
tuple_debug, tuple_struct_debug, DynamicTypePath, DynamicTyped, OpaqueInfo, ReflectKind, tuple_struct_debug, DynamicTypePath, DynamicTyped, OpaqueInfo, ReflectKind,
ReflectKindMismatchError, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, Typed, ReflectKindMismatchError, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, Typed,
}; };
use alloc::boxed::Box; 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<Serializable> {
None
}
/// Indicates whether or not this type is a _dynamic_ type. /// Indicates whether or not this type is a _dynamic_ type.
/// ///
/// Dynamic types include the ones built-in to this [crate], /// Dynamic types include the ones built-in to this [crate],