aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dbac013..3656bf7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -473,6 +473,15 @@ impl TypeTransform {
quote! {#arg.map_err(|x| #err_inner)}
}
}
+ TypeTransform::Tuple(types) => {
+ let idents = (0..types.len()).map(|i| format_ident!("v{}", i));
+ // FUTURE: let transforms = std::iter::zip(idents, types).map(|(i, t)| t.convert(quote! {#i}));
+ let transforms = types.iter().enumerate().map(|(idx, t)| {
+ let id = format_ident!("v{}", idx);
+ t.convert(quote! {#id})
+ });
+ quote! { {let (#(#idents),*) = #arg; (#(#transforms),*)} }
+ }
TypeTransform::IntoIterMapCollect(types) => {
let idents = (0..types.len()).map(|i| format_ident!("v{}", i));
// FUTURE: let transforms = std::iter::zip(idents, types).map(|(i, t)| t.convert(quote! {#i}));