Skip to content
Myr

Use `variant` name for field instead of `field`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Mingun · committed by Mingun · parent 6805bba · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:serde_derive/src/de.rs+6 added-6 removed
1592 unmodified lines
1593 }1594 } else {1595 quote! {1596 let __seed = __Seed {1597 field: #variant_from_map,1597 variant: #variant_from_map,1598 marker: _serde::#private::PhantomData,1599 lifetime: _serde::#private::PhantomData,1600 };1601 let __deserializer = _serde::#private::de::ContentDeserializer::<__A::Error>::new(__content);
9 unmodified lines
1611 #variants_stmt16121613 #[doc(hidden)]1614 struct __Seed #de_impl_generics #where_clause {1615 field: __Field,1615 variant: __Field,1616 marker: _serde::#private::PhantomData<#this_type #ty_generics>,1617 lifetime: _serde::#private::PhantomData<&#delife ()>,1618 }1619
4 unmodified lines
1624 fn deserialize<__D>(self, __deserializer: __D) -> _serde::#private::Result<Self::Value, __D::Error>1625 where1626 __D: _serde::Deserializer<#delife>,1627 {1628 match self.field {1628 match self.variant {1629 #(#variant_arms)*1630 }1631 }1632 }
31 unmodified lines
1664 // Second key is the content.1665 _serde::#private::Some(_serde::#private::de::TagOrContentField::Content) => {1666 let __ret = _serde::de::MapAccess::next_value_seed(&mut __map,1667 __Seed {1668 field: __field,1668 variant: __field,1669 marker: _serde::#private::PhantomData,1670 lifetime: _serde::#private::PhantomData,1671 })?;1672 // Visit remaining keys, looking for duplicates.
35 unmodified lines
1708 __A: _serde::de::SeqAccess<#delife>,1709 {1710 // Visit the first element - the tag.1711 match _serde::de::SeqAccess::next_element(&mut __seq)? {1712 _serde::#private::Some(__field) => {1712 _serde::#private::Some(__variant) => {1713 // Visit the second element - the content.1714 match _serde::de::SeqAccess::next_element_seed(1715 &mut __seq,1716 __Seed {1717 field: __field,1717 variant: __variant,1718 marker: _serde::#private::PhantomData,1719 lifetime: _serde::#private::PhantomData,1720 },1721 )? {
1531 unmodified lines