]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Handle type aliases which are used in the same file as declared.
authorMatt Corallo <git@bluematt.me>
Thu, 15 Apr 2021 17:10:22 +0000 (13:10 -0400)
committerMatt Corallo <git@bluematt.me>
Thu, 15 Apr 2021 21:59:35 +0000 (17:59 -0400)
We previously only handled type aliases correctly when they were
declared in a different file and imported.

c-bindings-gen/src/types.rs

index 92da8727929bd1f0ef43b245fc2895b05bc95aa0..16f3ff56663300631a80467f0fade67cd66dd0c6 100644 (file)
@@ -413,10 +413,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
                                                        else { process_alias = false; }
                                                }
                                                if process_alias {
-                                                       match &*t.ty {
-                                                               syn::Type::Path(_) => { declared.insert(t.ident.clone(), DeclType::StructImported); },
-                                                               _ => {},
-                                                       }
+                                                       declared.insert(t.ident.clone(), DeclType::StructImported);
                                                }
                                        }
                                },