From: Matt Corallo Date: Mon, 1 Mar 2021 22:08:51 +0000 (-0500) Subject: [bindings] Handle ::-containing paths in generics X-Git-Tag: v0.0.13~6^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=f7f7500da58b0999ae4f63d27efb67a91586f4fe;p=rust-lightning [bindings] Handle ::-containing paths in generics Specifically, this is required for some paths which use `Option`. --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 3e6acaa8d..ad21b4c6b 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -1946,11 +1946,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if !self.write_c_path_intern(w, &$p_arg.path, generics, true, true, true) { return false; } } } else { - if $p_arg.path.segments.len() == 1 { - write!(w, "{}", $p_arg.path.segments.iter().next().unwrap().ident).unwrap(); - } else { - return false; - } + write!(w, "{}", $p_arg.path.segments.last().unwrap().ident).unwrap(); } } else if self.is_known_container(&subtype, is_ref) || self.is_transparent_container(&subtype, is_ref) { if !self.write_c_mangled_container_path_intern(w, Self::path_to_generic_args(&$p_arg.path), generics,