mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
Revert "Support deserialization of struct keys from integers"
This is not as useful as expected because the Serializer does not know the real
index of each struct field being serialized. The best it can do is keep a
counter, which goes wrong if fields are conditionally skipped.
This reverts commit eec7101894.
This commit is contained in:
@@ -605,17 +605,6 @@ declare_tests! {
|
||||
Token::StructEnd,
|
||||
],
|
||||
}
|
||||
test_struct_integer_keys {
|
||||
Struct { a: 1, b: 2, c: 0 } => &[
|
||||
Token::Struct { name: "Struct", len: 2 },
|
||||
Token::U32(0),
|
||||
Token::I32(1),
|
||||
|
||||
Token::U32(1),
|
||||
Token::I32(2),
|
||||
Token::StructEnd,
|
||||
],
|
||||
}
|
||||
test_enum_unit {
|
||||
Enum::Unit => &[
|
||||
Token::UnitVariant { name: "Enum", variant: "Unit" },
|
||||
|
||||
Reference in New Issue
Block a user