Rename unit struct to a generic name: Info->Unit

This commit is contained in:
Mingun 2023-08-07 21:35:02 +05:00
parent 2d75ef6b30
commit 93bda5f1dc

View File

@ -636,16 +636,16 @@ fn newtype_variant_containing_externally_tagged_enum() {
#[test]
fn newtype_variant_containing_unit_struct() {
#[derive(Debug, PartialEq, Serialize, Deserialize)]
struct Info;
struct Unit;
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "tag")]
enum Message {
Info(Info),
Info(Unit),
}
assert_tokens(
&Message::Info(Info),
&Message::Info(Unit),
&[
Token::Map { len: Some(1) },
Token::Str("tag"),
@ -655,7 +655,7 @@ fn newtype_variant_containing_unit_struct() {
);
assert_de_tokens(
&Message::Info(Info),
&Message::Info(Unit),
&[
Token::Struct {
name: "Message",
@ -668,7 +668,7 @@ fn newtype_variant_containing_unit_struct() {
);
assert_de_tokens(
&Message::Info(Info),
&Message::Info(Unit),
&[
Token::Seq { len: Some(1) },
Token::Str("Info"),