+ write!(&mut constr, ") -> {} {{\n\t{}::{}", e.ident, e.ident, var.ident).unwrap();
+ if let syn::Fields::Named(fields) = &var.fields {
+ writeln!(&mut constr, " {{").unwrap();
+ for field in fields.named.iter() {
+ writeln!(&mut constr, "\t\t{},", field.ident.as_ref().unwrap()).unwrap();
+ }
+ writeln!(&mut constr, "\t}}").unwrap();
+ } else if let syn::Fields::Unnamed(fields) = &var.fields {
+ if !empty_tuple_variant {
+ write!(&mut constr, "(").unwrap();
+ for idx in 0..fields.unnamed.len() {
+ write!(&mut constr, "{}, ", ('a' as u8 + idx as u8) as char).unwrap();
+ }
+ writeln!(&mut constr, ")").unwrap();
+ } else {
+ writeln!(&mut constr, "").unwrap();
+ }
+ }
+ writeln!(&mut constr, "}}").unwrap();