]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Expose a `BigEndianScalar_clone` method
authorMatt Corallo <git@bluematt.me>
Mon, 13 May 2024 18:31:53 +0000 (18:31 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 13 May 2024 18:32:24 +0000 (18:32 +0000)
lightning-c-bindings/src/c_types/mod.rs

index d4f4fafe5abd7232b1f550cf6fdf8f8c32160672..c8e140b3eae35316a711c8f4a60735f30ee3a40e 100644 (file)
@@ -292,6 +292,9 @@ impl BigEndianScalar {
 pub extern "C" fn BigEndianScalar_new(big_endian_bytes: ThirtyTwoBytes) -> BigEndianScalar {
        BigEndianScalar { big_endian_bytes: big_endian_bytes.data }
 }
+#[no_mangle]
+/// Creates a new BigEndianScalar which has the same data as `orig`
+pub extern "C" fn BigEndianScalar_clone(orig: &BigEndianScalar) -> BigEndianScalar { orig.clone() }
 
 #[repr(C)]
 #[derive(Copy, Clone)]