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:
8ec4367
)
Support `use self::...` statements as they are sometimes use for submodules
author
Matt Corallo
<git@bluematt.me>
Wed, 24 Nov 2021 18:07:57 +0000
(18:07 +0000)
committer
Matt Corallo
<git@bluematt.me>
Tue, 30 Nov 2021 16:05:44 +0000
(16:05 +0000)
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 cd537522505615082ae2e99edef5eca1fd4c142e..f5417010aeafa4aae98a5ba82b7d0ee9375a4924 100644
(file)
--- a/
c-bindings-gen/src/types.rs
+++ b/
c-bindings-gen/src/types.rs
@@
-415,6
+415,11
@@
impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
for module in super_mod.split("::") {
path.push(syn::PathSegment { ident: syn::Ident::new(module, Span::call_site()), arguments: syn::PathArguments::None });
}
for module in super_mod.split("::") {
path.push(syn::PathSegment { ident: syn::Ident::new(module, Span::call_site()), arguments: syn::PathArguments::None });
}
+ } else if partial_path == "" && format!("{}", $ident) == "self" {
+ new_path = format!("{}{}", module_path, $path_suffix);
+ for module in module_path.split("::") {
+ path.push(syn::PathSegment { ident: syn::Ident::new(module, Span::call_site()), arguments: syn::PathArguments::None });
+ }
} else if partial_path == "" && format!("{}", $ident) == "crate" {
new_path = format!("{}{}", crate_name, $path_suffix);
let crate_name_ident = format_ident!("{}", crate_name);
} else if partial_path == "" && format!("{}", $ident) == "crate" {
new_path = format!("{}{}", crate_name, $path_suffix);
let crate_name_ident = format_ident!("{}", crate_name);