mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-27 13:00:49 +00:00
Rename enum_untagged::generate_variant -> deserialize_variant
This commit is contained in:
parent
8047570160
commit
11ce4402bd
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user