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