mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 04:48:01 +00:00
Restore visit_bytes for identifying variants and fields
This commit is contained in:
@@ -3,7 +3,7 @@ use std::net;
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
|
||||
use serde::de::{Deserialize, Type};
|
||||
use serde::de::Deserialize;
|
||||
|
||||
extern crate fnv;
|
||||
use self::fnv::FnvHasher;
|
||||
@@ -781,6 +781,13 @@ declare_tests! {
|
||||
Token::Unit,
|
||||
],
|
||||
}
|
||||
test_enum_unit_bytes {
|
||||
Enum::Unit => &[
|
||||
Token::EnumStart("Enum"),
|
||||
Token::Bytes(b"Unit"),
|
||||
Token::Unit,
|
||||
],
|
||||
}
|
||||
test_box {
|
||||
Box::new(0i32) => &[Token::I32(0)],
|
||||
}
|
||||
@@ -933,12 +940,4 @@ declare_error_tests! {
|
||||
],
|
||||
Error::InvalidValue("expected variant index 0 <= i < 4".to_owned()),
|
||||
}
|
||||
test_enum_unit_bytes<Enum> {
|
||||
&[
|
||||
Token::EnumStart("Enum"),
|
||||
Token::Bytes(b"Unit"),
|
||||
Token::Unit,
|
||||
],
|
||||
Error::InvalidType(Type::Bytes),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user