Revert "Catch wrong field names length in serde_test"

There are at least two reasonable things to expect the len field to
check: the length of the fields array passed to deserialize_struct, or
the number of field tokens. Even beyond these, in some cases it can be
useful to test deserialization with a bogus len to test how the
Deserialize impl reacts to an incorrect size_hint.

This reverts commit 436cafb0a3 which was
released in serde_test 1.0.20.
This commit is contained in:
David Tolnay
2017-11-29 22:07:29 -08:00
parent 797d049db5
commit eb6bf16a51
2 changed files with 2 additions and 10 deletions
+2 -2
View File
@@ -352,8 +352,8 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
V: Visitor<'de>,
{
match self.peek_token() {
Token::Struct { .. } => {
assert_next_token!(self, Token::Struct { name: name, len: fields.len() });
Token::Struct { len: n, .. } => {
assert_next_token!(self, Token::Struct { name: name, len: n });
self.visit_map(Some(fields.len()), Token::StructEnd, visitor)
}
Token::Map { .. } => {