Reflect SmolStr's De/Serialize implementation (#14982)

# Objective

- Fixes #14969

## Solution

- Added `Deserialize` to the list of reflected traits for `SmolStr`

## Testing

- CI passed locally.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
Zachary Harrold 2024-09-03 08:35:17 +10:00 committed by GitHub
parent d2624765d0
commit 547b1c7a7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -37,7 +37,7 @@ smallvec = { version = "1.11", optional = true }
glam = { version = "0.28", features = ["serde"], optional = true }
petgraph = { version = "0.6", features = ["serde-1"], optional = true }
smol_str = { version = "0.2.0", optional = true }
smol_str = { version = "0.2.0", features = ["serde"], optional = true }
uuid = { version = "1.0", optional = true, features = ["v4", "serde"] }
[dev-dependencies]

View file

@ -1,8 +1,15 @@
use crate::std_traits::ReflectDefault;
use crate::{self as bevy_reflect};
use crate::{std_traits::ReflectDefault, ReflectDeserialize, ReflectSerialize};
use bevy_reflect_derive::impl_reflect_value;
impl_reflect_value!(::smol_str::SmolStr(Debug, Hash, PartialEq, Default));
impl_reflect_value!(::smol_str::SmolStr(
Debug,
Hash,
PartialEq,
Default,
Serialize,
Deserialize,
));
#[cfg(test)]
mod tests {