[bindings] Use new non-null annotation feature in cbindgen
[rust-lightning] / c-bindings-gen / src / types.rs
index bf591a2673e752dc9058a6576424d9bd25298e5b..d6a2c989e1ab21694882fd0c713d311f655800c4 100644 (file)
@@ -719,7 +719,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
        /// Returns the module path in the generated mapping crate to the containers which we generate
        /// when writing to CrateTypes::template_file.
-       fn generated_container_path() -> &'static str {
+       pub fn generated_container_path() -> &'static str {
                "crate::c_types::derived"
        }
        /// Returns the module path in the generated mapping crate to the container templates, which
@@ -906,7 +906,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                self.declared.get(ident)
        }
        /// Returns true if the object at the given path is mapped as X { inner: *mut origX, .. }.
-       fn c_type_has_inner_from_path(&self, full_path: &str) -> bool{
+       pub fn c_type_has_inner_from_path(&self, full_path: &str) -> bool{
                self.crate_types.opaques.get(full_path).is_some()
        }
 
@@ -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);