Remove unneeded explicit type parameters in test_from_into_traits

This commit is contained in:
David Tolnay 2019-07-17 12:32:34 -07:00
parent b941c63a53
commit d0fb958e99
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -1610,13 +1610,13 @@ impl TryFrom<u32> for TryFromU32 {
#[test]
fn test_from_into_traits() {
assert_ser_tokens::<EnumToU32>(&EnumToU32::One, &[Token::Some, Token::U32(1)]);
assert_ser_tokens::<EnumToU32>(&EnumToU32::Nothing, &[Token::None]);
assert_de_tokens::<EnumToU32>(&EnumToU32::Two, &[Token::Some, Token::U32(2)]);
assert_ser_tokens::<StructFromEnum>(&StructFromEnum(Some(5)), &[Token::None]);
assert_ser_tokens::<StructFromEnum>(&StructFromEnum(None), &[Token::None]);
assert_de_tokens::<StructFromEnum>(&StructFromEnum(Some(2)), &[Token::Some, Token::U32(2)]);
assert_de_tokens::<TryFromU32>(&TryFromU32::Two, &[Token::U32(2)]);
assert_ser_tokens(&EnumToU32::One, &[Token::Some, Token::U32(1)]);
assert_ser_tokens(&EnumToU32::Nothing, &[Token::None]);
assert_de_tokens(&EnumToU32::Two, &[Token::Some, Token::U32(2)]);
assert_ser_tokens(&StructFromEnum(Some(5)), &[Token::None]);
assert_ser_tokens(&StructFromEnum(None), &[Token::None]);
assert_de_tokens(&StructFromEnum(Some(2)), &[Token::Some, Token::U32(2)]);
assert_de_tokens(&TryFromU32::Two, &[Token::U32(2)]);
assert_de_tokens_error::<TryFromU32>(&[Token::U32(5)], "out of range");
}