From c038abcf69eab334ad9be6af12228022b115b9a4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 30 May 2022 23:52:32 +0000 Subject: [PATCH] XXX update path thingz --- c-bindings-gen/src/types.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index ca36c9d..b10ce3d 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -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("\")"), -- 2.30.2