mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-15 05:01:02 +00:00
ignore_variant variable is always None, let's take this into account
This commit is contained in:
@@ -1247,19 +1247,19 @@ fn prepare_enum_variant_enum(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let (ignore_variant, fallthrough) = if let Some(other_idx) = other_idx {
|
let fallthrough = if let Some(other_idx) = other_idx {
|
||||||
let ignore_variant = variant_names_idents[other_idx].1.clone();
|
let ignore_variant = variant_names_idents[other_idx].1.clone();
|
||||||
let fallthrough = quote!(_serde::__private::Ok(__Field::#ignore_variant));
|
let fallthrough = quote!(_serde::__private::Ok(__Field::#ignore_variant));
|
||||||
(None, Some(fallthrough))
|
Some(fallthrough)
|
||||||
} else {
|
} else {
|
||||||
(None, None)
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let variant_visitor = Stmts(deserialize_generated_identifier(
|
let variant_visitor = Stmts(deserialize_generated_identifier(
|
||||||
&variant_names_idents,
|
&variant_names_idents,
|
||||||
cattrs,
|
cattrs,
|
||||||
true,
|
true,
|
||||||
ignore_variant,
|
None,
|
||||||
fallthrough,
|
fallthrough,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user