Closed ozgunozerk closed 1 year ago
You can implement this as:
let types = std::iter::repeat(types);
quote! {
pub enum Trial {
#(
#names(#(#types),*),
)*
Finished,
Cancelled,
}
}
or as:
let fields = quote!(#(#types),*);
quote! {
pub enum Trial {
#(
#names(#fields),
)*
Finished,
Cancelled,
}
}
I'm unable to do nested interpolation for vectors.
and using these, I'm trying to generate the following:
The code I'm using to generate this:
Which does not work, and gives the error
mismatched types -> expected struct `HasIterator`, found struct `ThereIsNoIteratorInRepetition`
I'm able to do a single interpolation for both the types, and the names, here is the code:
any help/idea on how to accomplish my goal?