XXX update path thingz
[ldk-c-bindings] / c-bindings-gen / src / types.rs
index ca36c9d60e0c1dd5fc2cfd8072905c0d63515698..b10ce3ded424fbf0fa15cb8f64de3ac918dc64e1 100644 (file)
@@ -827,7 +827,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
        /// Returns true we if can just skip passing this to C entirely
        fn no_arg_path_to_rust(&self, full_path: &str) -> &str {
                if full_path == "bitcoin::secp256k1::Secp256k1" {
-                       "secp256k1::SECP256K1"
+                       "secp256k1::global::SECP256K1"
                } else { unimplemented!(); }
        }
 
@@ -874,7 +874,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "std::time::Duration"|"core::time::Duration" => Some("u64"),
                        "std::time::SystemTime" => Some("u64"),
-                       "std::io::Error" => Some("crate::c_types::IOError"),
+                       "std::io::Error"|"lightning::io::Error" => Some("crate::c_types::IOError"),
                        "core::fmt::Arguments" if is_ref => Some("crate::c_types::Str"),
 
                        "core::convert::Infallible" => Some("crate::c_types::NotConstructable"),
@@ -954,7 +954,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "str" if is_ref => Some(""),
                        "alloc::string::String"|"String" => Some(""),
-                       "std::io::Error" if !is_ref => Some(""),
+                       "std::io::Error"|"lightning::io::Error" => Some(""),
                        // Note that we'll panic for String if is_ref, as we only have non-owned memory, we
                        // cannot create a &String.
 
@@ -1040,7 +1040,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "str" if is_ref => Some(".into_str()"),
                        "alloc::string::String"|"String" => Some(".into_string()"),
-                       "std::io::Error" if !is_ref => Some(".to_rust()"),
+                       "std::io::Error"|"lightning::io::Error" => Some(".to_rust()"),
 
                        "core::convert::Infallible" => Some("\")"),
 
@@ -1132,7 +1132,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "std::time::Duration"|"core::time::Duration" => Some(""),
                        "std::time::SystemTime" => Some(""),
-                       "std::io::Error" if !is_ref => Some("crate::c_types::IOError::from_rust("),
+                       "std::io::Error"|"lightning::io::Error" => Some("crate::c_types::IOError::from_rust("),
                        "core::fmt::Arguments" => Some("alloc::format!(\"{}\", "),
 
                        "core::convert::Infallible" => Some("panic!(\"Cannot construct an Infallible: "),
@@ -1208,7 +1208,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "std::time::Duration"|"core::time::Duration" => Some(".as_secs()"),
                        "std::time::SystemTime" => Some(".duration_since(::std::time::SystemTime::UNIX_EPOCH).expect(\"Times must be post-1970\").as_secs()"),
-                       "std::io::Error" if !is_ref => Some(")"),
+                       "std::io::Error"|"lightning::io::Error" => Some(")"),
                        "core::fmt::Arguments" => Some(").into()"),
 
                        "core::convert::Infallible" => Some("\")"),