mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-26 20:40:35 +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:
parent
1799547846
commit
15be2a600a
@ -1868,8 +1868,11 @@ fn deserialize_internally_tagged_variant(
|
||||
cattrs: &attr::Container,
|
||||
deserializer: TokenStream,
|
||||
) -> Fragment {
|
||||
if variant.attrs.deserialize_with().is_some() {
|
||||
return deserialize_untagged_variant(params, variant, cattrs, deserializer);
|
||||
if let Some(path) = variant.attrs.deserialize_with() {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user