mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 15:31:07 +00:00
Remove confusing call to deserialize_untagged_variant in deserialize_internally_tagged_variant
deserialize_untagged_variant in that place is called when deserialzie_with attribute is set. In that case it performs special actions that is better to use explicitly in deserialize_untagged_variant for readability
This commit is contained in:
@@ -1868,8 +1868,11 @@ fn deserialize_internally_tagged_variant(
|
|||||||
cattrs: &attr::Container,
|
cattrs: &attr::Container,
|
||||||
deserializer: TokenStream,
|
deserializer: TokenStream,
|
||||||
) -> Fragment {
|
) -> Fragment {
|
||||||
if variant.attrs.deserialize_with().is_some() {
|
if let Some(path) = variant.attrs.deserialize_with() {
|
||||||
return deserialize_untagged_variant(params, variant, cattrs, deserializer);
|
let unwrap_fn = unwrap_to_variant_closure(params, variant, false);
|
||||||
|
return quote_block! {
|
||||||
|
_serde::#private::Result::map(#path(#deserializer), #unwrap_fn)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let variant_ident = &variant.ident;
|
let variant_ident = &variant.ident;
|
||||||
|
|||||||
Reference in New Issue
Block a user