yassun7010 / serde_valid

JSON Schema based validation tool using serde.
MIT License
45 stars 10 forks source link

#[derive(Validate)] of enum produces unparsable tokens #54

Closed Youx closed 6 months ago

Youx commented 7 months ago

This error happens if an enum unit variant is placed before an enum struct/tuple variant:

Reproduced with:

#[derive(serde_valid::Validate)]
enum Works {
    VariantB(),
    VariantA,
}

#[derive(serde_valid::Validate)]
enum Fails {
    VariantA,
    VariantB(),
}
yassun7010 commented 6 months ago

I was late in noticing the issue.

Thanks for the report 👍 I have fixed it.