]> git.bitcoin.ninja Git - rust-lightning/commitdiff
[bindings] Allow `write_rust_type` to handle leading-colon paths
authorMatt Corallo <git@bluematt.me>
Thu, 31 Dec 2020 00:46:39 +0000 (19:46 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 15 Jan 2021 00:49:14 +0000 (19:49 -0500)
It just stubs out to `write_rust_path` in this case anyway, which
handles leading-colons just fine, so no need to panic on them.

c-bindings-gen/src/types.rs

index eacae9034264a214b071c2bc03203e1216893d81..d6a2c989e1ab21694882fd0c713d311f655800c4 100644 (file)
@@ -1053,7 +1053,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
        pub fn write_rust_type<W: std::io::Write>(&self, w: &mut W, generics: Option<&GenericTypes>, t: &syn::Type) {
                match t {
                        syn::Type::Path(p) => {
-                               if p.qself.is_some() || p.path.leading_colon.is_some() {
+                               if p.qself.is_some() {
                                        unimplemented!();
                                }
                                self.write_rust_path(w, generics, &p.path);