Improve error for struct deserialized from array that is too short

This commit is contained in:
David Tolnay
2018-05-08 12:03:35 -07:00
parent 67777eb585
commit 4ad140ea70
2 changed files with 20 additions and 8 deletions
+2 -2
View File
@@ -1300,7 +1300,7 @@ fn test_invalid_length_enum() {
Token::I32(1),
Token::TupleVariantEnd,
],
"invalid length 1, expected tuple of 3 elements",
"invalid length 1, expected tuple variant InvalidLengthEnum::A with 3 elements",
);
assert_de_tokens_error::<InvalidLengthEnum>(
&[
@@ -1312,7 +1312,7 @@ fn test_invalid_length_enum() {
Token::I32(1),
Token::TupleVariantEnd,
],
"invalid length 1, expected tuple of 2 elements",
"invalid length 1, expected tuple variant InvalidLengthEnum::B with 2 elements",
);
}