Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Diggsey opened this issue Apr 24, 2021 · 0 comments · May be fixed by #33
Open

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

Diggsey opened this issue Apr 24, 2021 · 0 comments · May be fixed by #33

Comments

@Diggsey
Copy link

Diggsey commented Apr 24, 2021

        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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant