You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.It looks like
// Entry point for enumerations without values
has existed since 0.1.0?From<$enum> for FlagSet<$enum>
is the only macro-generatedFrom
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.The text was updated successfully, but these errors were encountered: