From: Matt Corallo Date: Thu, 28 Sep 2023 02:33:58 +0000 (+0000) Subject: Handle type references which refer to a module defined in scope X-Git-Tag: v0.0.117.0^2~9 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=87b49686773385dda0317365567584e0a48f1bd0;p=ldk-c-bindings Handle type references which refer to a module defined in scope eg ``` mod module; fn a() -> module::Type { todo!() } ``` --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 5f9e581..6a5f3e2 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -679,6 +679,8 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr Some(first_seg_str + &remaining) } else if first_seg_str == "crate" { Some(self.crate_name.to_owned() + &remaining) + } else if self.library.modules.get(&format!("{}::{}", self.module_path, first_seg.ident)).is_some() { + Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining)) } else { None } } }