]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Handle path types that start with `crate::`
authorMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 00:20:38 +0000 (00:20 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 28 Oct 2022 01:31:25 +0000 (01:31 +0000)
c-bindings-gen/src/types.rs

index ecc508dbca8d26ff0ab7ec92df486562e39095d6..9462e988418a1387a0048624555dec99feecaaba 100644 (file)
@@ -650,6 +650,8 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
                                Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining))
                        } else if first_seg_is_stdlib(&first_seg_str) || self.dependencies.contains(&first_seg.ident) {
                                Some(first_seg_str + &remaining)
+                       } else if first_seg_str == "crate" {
+                               Some(self.crate_name.to_owned() + &remaining)
                        } else { None }
                }
        }