As is, the example below can be a necessary evil. Using separate, concrete structs allows the data to be passed as a single value.
fn main() {
// ...
match sql_ast {
SQLSelect { projection, relation, joins, selection,
order_by, group_by, having, limit } => {
select(projection, relation, joins, selection,
order_by, group_by, having, limit, &mut out_ts);
},
_ => {}
}
}
fn select(projection: Vec<ASTNode>, relation: Option<Box<ASTNode>>, joins: Vec<Join>,
selection: Option<Box<ASTNode>>, order_by: Option<Vec<SQLOrderByExpr>>,
group_by: Option<Vec<ASTNode>>, having: Option<Box<ASTNode>>, limit: Option<Box<ASTNode>>,
out_ts: &mut TokenStream) {
// ...
}
As is, the example below can be a necessary evil. Using separate, concrete structs allows the data to be passed as a single value.