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

Support Enum numbered variant parsing #102

Merged
merged 1 commit into from
May 12, 2024
Merged

Conversation

flukejones
Copy link
Contributor

Allows ser/de of enums such as:

pub enum Fud {
    A = 0,
    B = 1,
    C = 2,
}

Should close #101

Allows ser/de of enums such as:

```rust
pub enum Fud {
    A = 0,
    B = 1,
    C = 2,
}
```

Should close not-fl3#101

Signed-off-by: Luke D. Jones <[email protected]>
@flukejones
Copy link
Contributor Author

I don't know if this is the best way to do this, I'm basically making a hard assumption that and enum variant with <Var> = <num>, always being correct.

@knickish
Copy link
Collaborator

knickish commented May 8, 2024

I've been traveling for work this week, so haven't had time to review yet. Will try to get it done by end of the weekend at least. Thanks for putting this up

@flukejones
Copy link
Contributor Author

No worries mate. Turns out I can't use it in the areas I wanted to due to the pervasiveness of serde, but I have a few other projects I'll be converting.

Copy link
Owner

@not-fl3 not-fl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I do not see any potential problems here and the PR does solve a real issue.

@knickish
Copy link
Collaborator

@flukejones Would you mind backing out my commit on this so I can clean it up and merge these separately?

@flukejones
Copy link
Contributor Author

Oh crap sorry I thought you'd already merged. Will do this soon

@flukejones
Copy link
Contributor Author

Should be done now

@knickish knickish merged commit 5919db4 into not-fl3:master May 12, 2024
16 checks passed
@knickish
Copy link
Collaborator

Thanks @flukejones , this is in now

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 this pull request may close these issues.

Unamed variants issue on complex enums
3 participants