1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use shebling_codegen::struct_enum; // The attribute should handle generics just fine. struct Foo<T> { foo: T, } #[struct_enum] enum Bar<T> { Foo(Foo<T>), } fn main() { let foo = Foo { foo: 17 }; let bar = Bar::from(foo); assert!(matches!(bar, Bar::Foo(_))); }