X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fc_types%2Fmod.rs;h=12c70888b20585ef73b9872dbbb892251af09795;hp=80f04c523f421d9fd2cd64fcbb9ae0c767781999;hb=8f3b8e4b52275f738016a4d1bbc8a0e9be90039e;hpb=da34358617f52371cbafa7ebe429ce8c8b1b32c4 diff --git a/lightning-c-bindings/src/c_types/mod.rs b/lightning-c-bindings/src/c_types/mod.rs index 80f04c5..12c7088 100644 --- a/lightning-c-bindings/src/c_types/mod.rs +++ b/lightning-c-bindings/src/c_types/mod.rs @@ -227,6 +227,12 @@ impl Bech32Error { } } } +#[no_mangle] +/// Creates a new Bech32Error which has the same data as `orig` +pub extern "C" fn Bech32Error_clone(orig: &Bech32Error) -> Bech32Error { orig.clone() } +#[no_mangle] +/// Releases any memory held by the given `Bech32Error` (which is currently none) +pub extern "C" fn Bech32Error_free(o: Bech32Error) { } #[repr(C)] #[derive(Clone, Copy, PartialEq)] @@ -563,7 +569,7 @@ impl Into for String { } impl Clone for Str { fn clone(&self) -> Self { - self.into_str().clone().into() + String::from(self.into_str()).into() } }