Tuple enums

This commit is contained in:
Graham Esau 2019-08-04 22:45:05 +01:00
parent 3be97a7da4
commit 8b034f4dd8

View file

@ -94,7 +94,12 @@ fn schema_for_enum(variants: &[Variant]) -> TokenStream {
gen.subschema_for::<#ty>()
}
}
Style::Tuple => unimplemented!("work in progress!"),
Style::Tuple => {
let types = variant.fields.iter().map(|f| f.ty);
quote! {
gen.subschema_for::<(#(#types),*)>()
}
}
Style::Struct => unimplemented!("work in progress!"),
Style::Unit => unreachable!("Unit variants already filtered out"),
};