projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d79103
)
Handle type references which refer to a module defined in scope
author
Matt Corallo
<git@bluematt.me>
Thu, 28 Sep 2023 02:33:58 +0000
(
02:33
+0000)
committer
Matt Corallo
<git@bluematt.me>
Wed, 4 Oct 2023 20:02:23 +0000
(20:02 +0000)
eg
```
mod module;
fn a() -> module::Type { todo!() }
```
c-bindings-gen/src/types.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/types.rs
b/c-bindings-gen/src/types.rs
index 5f9e5812aa4a4cc56c97ad71fca2fe2bc81c3c8e..6a5f3e25eb633945d4e686f89fa0d6926b601ae1 100644
(file)
--- 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 }
}
}