Register ReflectSerialize
for &'static str (#19680)
# Objective - When trying to serialize an structure that contains `&'static str` using only Reflection, I get the following error: ``` "type `&str` did not register the `ReflectSerialize` or `ReflectSerializeWithRegistry` type data. For certain types, this may need to be registered manually using `register_type_data` (stack: ... -> `core::option::Option<&str>` -> `&str`)") ``` ## Solution - Register `ReflectSerialize` for `&str` ## Testing - `cargo run -p ci`: OK
This commit is contained in:
parent
c0fa10b0c3
commit
20781371e8
@ -282,6 +282,7 @@ impl GetTypeRegistration for &'static str {
|
||||
let mut registration = TypeRegistration::of::<Self>();
|
||||
registration.insert::<ReflectFromPtr>(FromType::<Self>::from_type());
|
||||
registration.insert::<ReflectFromReflect>(FromType::<Self>::from_type());
|
||||
registration.insert::<ReflectSerialize>(FromType::<Self>::from_type());
|
||||
registration
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user