Skip to content

Commit

Permalink
Reflect SmolStr's De/Serialize implementation (#14982)
Browse files Browse the repository at this point in the history
# 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>
  • Loading branch information
bushrat011899 and alice-i-cecile authored Sep 2, 2024
1 parent d262476 commit 547b1c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 9 additions & 2 deletions crates/bevy_reflect/src/impls/smol_str.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 547b1c7

Please sign in to comment.