Skip to content

Enum variants are serialized as strings even when FieldPathMode == Index #32

@Diggsey

Description

@Diggsey
        let x = QueryResult::Test(1);
        let y = QueryResult::Test(2);

        let diff = serde_diff::Config::new()
            .with_field_path_mode(FieldPathMode::Index)
            .serializable_diff(&x, &y);
        let z = ron::to_string(&diff).unwrap();
        println!("{}", z);

Expected output:

[Enter(EnumVariantIndex(1)),Enter(FieldIndex(0)),Value(2),Exit]

Actual output:

[Enter(EnumVariant("Test")),Enter(FieldIndex(0)),Value(2),Exit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions