[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>
Wed, 3 Feb 2021 15:11:28 +0000 (10:11 -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 7ecd9ef1ed4b6c57feb69ea9178ce6c41b560676..628d263bf9a9775939a1c88ca3ec57e96840e362 100644 (file)
@@ -1061,7 +1061,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);