Skip to content

Commit

Permalink
bevy_reflect: Remove PartialReflect::serializable (#16576)
Browse files Browse the repository at this point in the history
# 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`.
  • Loading branch information
MrGVSV authored Dec 16, 2024
1 parent f2719f5 commit ca294a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
5 changes: 0 additions & 5 deletions crates/bevy_reflect/src/func/dynamic_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
DynamicFunctionMut, Function, FunctionOverloadError, FunctionResult, IntoFunction,
IntoFunctionMut,
},
serde::Serializable,
ApplyError, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned,
ReflectRef, TypeInfo, TypePath,
};
Expand Down Expand Up @@ -428,10 +427,6 @@ impl PartialReflect for DynamicFunction<'static> {
Debug::fmt(self, f)
}

fn serializable(&self) -> Option<Serializable> {
None
}

fn is_dynamic(&self) -> bool {
true
}
Expand Down
11 changes: 2 additions & 9 deletions crates/bevy_reflect/src/reflect.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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.
///
/// Dynamic types include the ones built-in to this [crate],
Expand Down

0 comments on commit ca294a8

Please sign in to comment.