aboutsummaryrefslogtreecommitdiff
path: root/src/transform.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-23 06:00:26 +0100
committerMartin Fischer <martin@push-f.com>2021-11-23 06:43:22 +0100
commit19dcb405cd4cfb960f51edbc1446e0a843772d6b (patch)
treefbd4a80460a20faea6975ae51939f463b612a6e3 /src/transform.rs
parentb4acbbf52be85595cf8dcb839217fc4e2958328e (diff)
support tuples
Diffstat (limited to 'src/transform.rs')
-rw-r--r--src/transform.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/transform.rs b/src/transform.rs
index 11a98c2..ddab158 100644
--- a/src/transform.rs
+++ b/src/transform.rs
@@ -61,7 +61,13 @@ impl TypeConverter<'_> {
return Ok(TypeTransform::NoOp);
}
- if let Type::Reference(TypeReference {
+ if let Type::Tuple(tuple) = type_ {
+ let mut types = Vec::new();
+ for elem in &mut tuple.elems {
+ types.push(self.convert_type(elem)?);
+ }
+ return Ok(TypeTransform::Tuple(types));
+ } else if let Type::Reference(TypeReference {
lifetime: None,
mutability: Some(_),
elem,