Add support for deserialization of custom type/shared value from into another Dynamic.
This commit is contained in:
@@ -124,6 +124,10 @@ impl<'de> Deserializer<'de> for DynamicDeserializer<'de> {
|
||||
type Error = RhaiError;
|
||||
|
||||
fn deserialize_any<V: Visitor<'de>>(self, visitor: V) -> RhaiResultOf<V::Value> {
|
||||
if type_name::<V::Value>() == type_name::<Dynamic>() {
|
||||
return Ok(reify! { self.0.clone() => !!! V::Value });
|
||||
}
|
||||
|
||||
match self.0 .0 {
|
||||
Union::Unit(..) => self.deserialize_unit(visitor),
|
||||
Union::Bool(..) => self.deserialize_bool(visitor),
|
||||
|
Reference in New Issue
Block a user