Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

serde_test::Token::UnitVariant should include variant_index #21

@survived

Description

@survived

Currently I'm not able to assert that my enum is correctly serialized using serde_test.

Note that Serializer::serialize_unit_variant accepts three arguments:

fn serialize_unit_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
) -> Result<Self::Ok, Self::Error>;

Only two of them are recorded in Token::UnitVariant:

pub enum Token {
    UnitVariant {
        name: &'static str,
        variant: &'static str,
    },
    // ...
}

I'd expect variant_index field to be recorded, though adding it now would require major version bump.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions