File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
gdnative-core/src/core_types Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -2187,6 +2187,10 @@ pub mod serde {
2187
2187
where
2188
2188
E : Error ,
2189
2189
{
2190
+ if v == "Nil" {
2191
+ //`VariantDispatch::Nil` could be represented as the string "Nil"
2192
+ return Ok ( Variant :: new ( ) )
2193
+ }
2190
2194
Ok ( v. to_variant ( ) )
2191
2195
}
2192
2196
@@ -2220,7 +2224,14 @@ pub mod serde {
2220
2224
{
2221
2225
Ok ( ( ) . to_variant ( ) )
2222
2226
}
2223
-
2227
+
2228
+ fn visit_newtype_struct < D > ( self , deserializer : D ) -> Result < Self :: Value , D :: Error >
2229
+ where
2230
+ D : Deserializer < ' de > ,
2231
+ {
2232
+ deserializer. deserialize_any ( VariantVisitor )
2233
+ }
2234
+
2224
2235
fn visit_seq < A > ( self , seq : A ) -> Result < Self :: Value , <A as SeqAccess < ' de > >:: Error >
2225
2236
where
2226
2237
A : SeqAccess < ' de > ,
@@ -2230,7 +2241,7 @@ pub mod serde {
2230
2241
. visit_seq ( seq)
2231
2242
. map ( VariantArray :: < Unique > :: owned_to_variant)
2232
2243
}
2233
-
2244
+
2234
2245
fn visit_map < A > ( self , map : A ) -> Result < Self :: Value , <A as MapAccess < ' de > >:: Error >
2235
2246
where
2236
2247
A : MapAccess < ' de > ,
@@ -2395,13 +2406,6 @@ pub mod serde {
2395
2406
2396
2407
Ok ( dict. owned_to_variant ( ) )
2397
2408
}
2398
-
2399
- fn visit_newtype_struct < D > ( self , deserializer : D ) -> Result < Self :: Value , D :: Error >
2400
- where
2401
- D : Deserializer < ' de > ,
2402
- {
2403
- deserializer. deserialize_any ( VariantVisitor )
2404
- }
2405
2409
}
2406
2410
2407
2411
impl < ' de > Deserialize < ' de > for Variant {
You can’t perform that action at this time.
0 commit comments