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

Out of date docs? Valueless variants *are* supported; From<$enum> for $integer is *not* impl'd #19

Open
EndilWayfare opened this issue Oct 22, 2021 · 0 comments

Comments

@EndilWayfare
Copy link

Hey, sweet crate by the way! Soooo glad I don't have to reinvent the wheel on this one.

Unless I'm missing something, a few statements on the flagset::flags doc page seem inaccurate.

Each enumeration value MUST have a specified value.

It looks like // Entry point for enumerations without values has existed since 0.1.0?

It is also worth noting that this macro automatically implements a variety of standard traits including:

  • Copy
  • Clone
    ...
  • From<$enum> for $integer
    ...

From<$enum> for FlagSet<$enum> is the only macro-generated From impl I see.

It's not a huge deal to me personally (I already have bidirectional From impls for non-flag instances generated by a c-style enum bindgen-oxidation macro I'm working on). I was just really confused at the observed behavior until I cracked open the source. I imagine future devs might encounter a similar situation so I figured I'd raise awareness.

@EndilWayfare EndilWayfare changed the title Out of date docs? Valueless variants are supported; From<$enum> for $integer is *not* impl'd Out of date docs? Valueless variants *are* supported; From<$enum> for $integer is *not* impl'd Oct 22, 2021
@dpal dpal added this to Enarx Board Jan 26, 2023
@dpal dpal moved this to New in Enarx Board Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

1 participant