From: Matt Corallo Date: Tue, 28 Feb 2023 23:31:11 +0000 (+0000) Subject: Support tuples containing array elements X-Git-Tag: v0.0.114.0^2~10 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=5dfc948805a85fdd0ca37386228114f55ce4287a;p=ldk-c-bindings Support tuples containing array elements --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 64f2a68..73ba02a 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -2817,6 +2817,13 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if let syn::Type::Path(p) = &*refelem.elem { write_path!(p, Some(&mut mangled_tuple_type)); } else { return false; } + } else if let syn::Type::Array(_) = elem { + let mut resolved = Vec::new(); + if !self.write_c_type_intern(&mut resolved, &elem, generics, false, false, true, false, true) { return false; } + let array_inner = String::from_utf8(resolved).unwrap(); + let arr_name = array_inner.split("::").last().unwrap(); + write!(w, "{}", arr_name).unwrap(); + write!(mangled_type, "{}", arr_name).unwrap(); } else { return false; } } write!(w, "Z").unwrap();