mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 13:47:58 +00:00
Remove redundant readable/compact tests
This functionality is covered well enough by the std::net types.
This commit is contained in:
@@ -548,26 +548,3 @@ fn test_enum_skipped() {
|
||||
"the enum variant Enum::SkippedMap cannot be serialized",
|
||||
);
|
||||
}
|
||||
|
||||
struct CompactBinary(String);
|
||||
|
||||
impl serde::Serialize for CompactBinary {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer
|
||||
{
|
||||
if serializer.is_human_readable() {
|
||||
serializer.serialize_str(&self.0)
|
||||
} else {
|
||||
serializer.serialize_bytes(self.0.as_bytes())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_human_readable() {
|
||||
let value = CompactBinary("test".to_string());
|
||||
assert_ser_tokens_readable(&value, &[Token::String("test")], Some(true));
|
||||
|
||||
assert_ser_tokens_readable(&value, &[Token::Bytes(b"test")], Some(false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user