diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-23 06:00:26 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-23 06:43:22 +0100 |
commit | 19dcb405cd4cfb960f51edbc1446e0a843772d6b (patch) | |
tree | fbd4a80460a20faea6975ae51939f463b612a6e3 /src/transform.rs | |
parent | b4acbbf52be85595cf8dcb839217fc4e2958328e (diff) |
support tuples
Diffstat (limited to 'src/transform.rs')
-rw-r--r-- | src/transform.rs | 8 |
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, |