X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fc_types%2Fderived.rs;h=d084a1562274f26f865d1ce0a499fb97631631ee;hb=5988789a2d0bc5121e6e56c1707396b8188027e1;hp=873f815f4ba9715ffaee3bf841bfb95a54008c19;hpb=7e18104414a30b9d527f604d360a18b4a93d344f;p=rust-lightning diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 873f815f..d084a156 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -19,10 +19,7 @@ pub type C2Tuple_usizeTransactionZ = crate::c_types::C2TupleTempl; #[no_mangle] pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ { - C2Tuple_usizeTransactionZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_usizeTransactionZ { a, b, } } #[no_mangle] @@ -67,10 +64,7 @@ pub type C2Tuple_OutPointScriptZ = crate::c_types::C2TupleTempl; #[no_mangle] pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ { - C2Tuple_OutPointScriptZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_OutPointScriptZ { a, b, } } #[no_mangle] @@ -89,10 +83,7 @@ pub type C2Tuple_TxidCVec_TxOutZZ = crate::c_types::C2TupleTempl>; #[no_mangle] pub extern "C" fn C2Tuple_TxidCVec_TxOutZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_TxOutZ) -> C2Tuple_TxidCVec_TxOutZZ { - C2Tuple_TxidCVec_TxOutZZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_TxidCVec_TxOutZZ { a, b, } } #[no_mangle] @@ -106,10 +97,7 @@ pub type C2Tuple_u64u64Z = crate::c_types::C2TupleTempl; pub static C2Tuple_u64u64Z_free: extern "C" fn(C2Tuple_u64u64Z) = crate::c_types::C2TupleTempl_free::; #[no_mangle] pub extern "C" fn C2Tuple_u64u64Z_new(a: u64, b: u64) -> C2Tuple_u64u64Z { - C2Tuple_u64u64Z { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_u64u64Z { a, b, } } #[no_mangle] @@ -128,10 +116,7 @@ pub type C2Tuple_SignatureCVec_SignatureZZ = crate::c_types::C2TupleTempl>; #[no_mangle] pub extern "C" fn C2Tuple_SignatureCVec_SignatureZZ_new(a: crate::c_types::Signature, b: crate::c_types::derived::CVec_SignatureZ) -> C2Tuple_SignatureCVec_SignatureZZ { - C2Tuple_SignatureCVec_SignatureZZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_SignatureCVec_SignatureZZ { a, b, } } #[no_mangle] @@ -269,11 +254,7 @@ pub type C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ = crate::c_types pub static C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free: extern "C" fn(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) = crate::c_types::C3TupleTempl_free::; #[no_mangle] pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - c: Box::into_raw(Box::new(c)), - } + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, } } #[no_mangle] @@ -375,10 +356,7 @@ pub type C2Tuple_HTLCOutputInCommitmentSignatureZ = crate::c_types::C2TupleTempl pub static C2Tuple_HTLCOutputInCommitmentSignatureZ_free: extern "C" fn(C2Tuple_HTLCOutputInCommitmentSignatureZ) = crate::c_types::C2TupleTempl_free::; #[no_mangle] pub extern "C" fn C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a: crate::ln::chan_utils::HTLCOutputInCommitment, b: crate::c_types::Signature) -> C2Tuple_HTLCOutputInCommitmentSignatureZ { - C2Tuple_HTLCOutputInCommitmentSignatureZ { - a: Box::into_raw(Box::new(a)), - b: Box::into_raw(Box::new(b)), - } + C2Tuple_HTLCOutputInCommitmentSignatureZ { a, b, } } #[no_mangle]