mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-29 18:47:57 +00:00
@@ -1387,10 +1387,10 @@ fn deserialize_identifier(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let visit_index = if is_variant {
|
let visit_index = if is_variant {
|
||||||
let variant_indices = 0u32..;
|
let variant_indices = 0u64..;
|
||||||
let fallthrough_msg = format!("variant index 0 <= i < {}", fields.len());
|
let fallthrough_msg = format!("variant index 0 <= i < {}", fields.len());
|
||||||
let visit_index = quote! {
|
let visit_index = quote! {
|
||||||
fn visit_u32<__E>(self, __value: u32) -> _serde::export::Result<Self::Value, __E>
|
fn visit_u64<__E>(self, __value: u64) -> _serde::export::Result<Self::Value, __E>
|
||||||
where __E: _serde::de::Error
|
where __E: _serde::de::Error
|
||||||
{
|
{
|
||||||
match __value {
|
match __value {
|
||||||
|
|||||||
@@ -23,7 +23,10 @@ fn test_variant_identifier() {
|
|||||||
Bbb,
|
Bbb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_de_tokens(&V::Aaa, &[Token::U8(0)]);
|
||||||
|
assert_de_tokens(&V::Aaa, &[Token::U16(0)]);
|
||||||
assert_de_tokens(&V::Aaa, &[Token::U32(0)]);
|
assert_de_tokens(&V::Aaa, &[Token::U32(0)]);
|
||||||
|
assert_de_tokens(&V::Aaa, &[Token::U64(0)]);
|
||||||
assert_de_tokens(&V::Aaa, &[Token::Str("Aaa")]);
|
assert_de_tokens(&V::Aaa, &[Token::Str("Aaa")]);
|
||||||
assert_de_tokens(&V::Aaa, &[Token::Bytes(b"Aaa")]);
|
assert_de_tokens(&V::Aaa, &[Token::Bytes(b"Aaa")]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user