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
I think it would make more sense to expose duplicate variants as associated constants rather than externally. Could be disabled by default for backwards compatibility.
I'd be happy to try myself if someone could point me the right direction.
The text was updated successfully, but these errors were encountered:
Lytigas
changed the title
Tweak Request: Add enum variants with the same value as associated constants
Tweak Request: Add identical enum variants as associated constants
Jul 29, 2018
This behavior looks strictly better to me so I'd be fine making it the default. Not sure since when it's available, but presumably we'd need to gate it with a rust feature gate, see features.rs for that.
Other than that, this should be somewhat straight-forward to implement.
The point where we handle the duplicated values for rust enums is:
if supported instead. It's probably easier to emit multiple impl blocks rather than coalescing them, even though the generated code won't be so pretty :)
I think it would make more sense to expose duplicate variants as associated constants rather than externally. Could be disabled by default for backwards compatibility.
yields
Requesting something like:
I'd be happy to try myself if someone could point me the right direction.
The text was updated successfully, but these errors were encountered: