I'm writing a procedural macro for generating code to implement a trait for enums.
Having the syn::Variant type for a NamedField, it's easy to generate code using to_token_stream(), but it includes all the types associated to the fields.
enum Message {
Quit,
Move { x: i32, y: i32 }, // this is easily recreated using to_token-stream()
Write(String),
ChangeColor(i32, i32, i32),
}
But what if I want to create a destructuring arm like:
Message::Move { x, y } => { // whatever code I want
}