subenum
subenum copied to clipboard
A Rust macro to make enums with a subset of values of the parent
Please consider this example: ``` pub struct Data {} #[subenum(Bar)] pub enum Foo { #[subenum(Bar)] Baz { data: Data }, } ``` This compiles, as expected. Consider if the `data`...
Using `subenum` 1.1.2 with Rust 1.77.2 (stable). Please consider this, which compiles OK: ``` #[subenum(Fruit)] pub enum Food { #[subenum(Fruit)] Apple {}, } ``` The addition of the `PartialEq` trait...
Fixes #16. If a subenum, A, is a subset of another subenum, B, `From for B` is generated, otherwise `TryFrom for B` is generated and uses the ConvertError from the...
I started this branch a while ago, need to spend some time figuring out what it needs to actually work. Tries to fix #13
This code: ```rust #[subenum(Dop)] enum Dip { A(&'a u8), } ``` which fails to compile. We should prune the lifetimes that don't show up in any variants, even if other...
Fixing #15 revealed another issue with documentation: We cannot have documentation on the parent separate from the child. We can already provide documentation on the child only (thanks to #21),...
Right now to convert two different subenum types to each other you must do the following ```rust #[subenum(A, B)] enum Foo { #[subenum(A, B) First, #[subenum(A, B) Second, Third, }...
This fails to compile: ```rust #[subenum(Looloo)] enum Frankie { #[subenum(Looloo)] A([u32; N]), } ```
Bump the version of syn to 2. This is mainly so I don't have two versions of syn in Cargo.lock