mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 17:11:02 +00:00
Rename enum_untagged::generate_variant -> deserialize_variant
This commit is contained in:
@@ -38,7 +38,7 @@ pub(super) fn deserialize(
|
|||||||
.map(|(i, variant)| {
|
.map(|(i, variant)| {
|
||||||
let variant_index = field_i(i);
|
let variant_index = field_i(i);
|
||||||
|
|
||||||
let block = Match(enum_untagged::generate_variant(params, variant, cattrs));
|
let block = Match(enum_untagged::deserialize_variant(params, variant, cattrs));
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
__Field::#variant_index => #block
|
__Field::#variant_index => #block
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ pub(super) fn deserialize(
|
|||||||
let attempts = variants
|
let attempts = variants
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|variant| !variant.attrs.skip_deserializing())
|
.filter(|variant| !variant.attrs.skip_deserializing())
|
||||||
.map(|variant| Expr(generate_variant(params, variant, cattrs)));
|
.map(|variant| Expr(deserialize_variant(params, variant, cattrs)));
|
||||||
// TODO this message could be better by saving the errors from the failed
|
// TODO this message could be better by saving the errors from the failed
|
||||||
// attempts. The heuristic used by TOML was to count the number of fields
|
// attempts. The heuristic used by TOML was to count the number of fields
|
||||||
// processed before an error, and use the error that happened after the
|
// processed before an error, and use the error that happened after the
|
||||||
@@ -59,7 +59,7 @@ pub(super) fn deserialize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Also used by adjacently tagged enums
|
// Also used by adjacently tagged enums
|
||||||
pub(super) fn generate_variant(
|
pub(super) fn deserialize_variant(
|
||||||
params: &Parameters,
|
params: &Parameters,
|
||||||
variant: &Variant,
|
variant: &Variant,
|
||||||
cattrs: &attr::Container,
|
cattrs: &attr::Container,
|
||||||
|
|||||||
Reference in New Issue
Block a user