]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Support `use ident;` in bindings
authorMatt Corallo <git@bluematt.me>
Tue, 15 Sep 2020 22:28:08 +0000 (18:28 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 12 Oct 2020 16:17:26 +0000 (12:17 -0400)
Somehow we'd never had any cases of it and it requires an extra
(trivial) match arm.

c-bindings-gen/src/types.rs

index 56bb4e67bc9411be155147a5af24ee920ac7545b..1db824d43128fc7675de4f7d6e0a3aaaa89c3056 100644 (file)
@@ -813,6 +813,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                let new_path = format!("{}", p.ident);
                                self.process_use_intern(w, &p.tree, &new_path);
                        },
+                       syn::UseTree::Name(n) => {
+                               let full_path = format!("{}", n.ident);
+                               self.imports.insert(n.ident.clone(), full_path);
+                       },
                        _ => unimplemented!(),
                }
                if u.leading_colon.is_some() { unimplemented!() }