First special rule: we need special handling for structured canonical data: in the case of the input map, it should not represent it as a hashmap, but unpack it into the input tuple sent to process_X_case.
That is, using abbreviate as an example, the generated code should not be:
process_abbreviate_case(
{
let mut hm = ::std::collections::HashMap::new();
hm.insert("phrase", "GNU Image Manipulation Program");
hm
},
"GIMP",
);
but instead:
process_abbreviate_case(
("GNU Image Manipulation Program",),
"GIMP",
);
Second special rule: when the tuple sent to input contains exactly one item, it doesn't need to be a tuple, but can be a bare item. This means that the same generated code for abbreviate would actually be:
process_abbreviate_case(
"GNU Image Manipulation Program",
"GIMP",
);
First special rule: we need special handling for structured canonical data: in the case of the
inputmap, it should not represent it as a hashmap, but unpack it into the input tuple sent toprocess_X_case.That is, using
abbreviateas an example, the generated code should not be:but instead:
Second special rule: when the tuple sent to input contains exactly one item, it doesn't need to be a tuple, but can be a bare item. This means that the same generated code for
abbreviatewould actually be: