X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_rapid_gossip_sync%2Ferror.rs;h=b7cd734035cfe0047f0baf3f9117743eab952e44;hb=2f70a371708dbfde3fa6abfcc0315736d2795a01;hp=808a81723ad9e2df0800442207b41ae0be05fd91;hpb=ae39d0e5a34ef021db50b12a7be96f0694fd1b18;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs b/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs index 808a817..b7cd734 100644 --- a/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs +++ b/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs @@ -38,13 +38,13 @@ impl GraphSyncError { pub(crate) fn to_native(&self) -> nativeGraphSyncError { match self { GraphSyncError::DecodeError (ref a, ) => { - let mut a_nonref = (*a).clone(); + let mut a_nonref = Clone::clone(a); nativeGraphSyncError::DecodeError ( - *unsafe { Box::from_raw(a_nonref.take_inner()) }, + a_nonref.into_native(), ) }, GraphSyncError::LightningError (ref a, ) => { - let mut a_nonref = (*a).clone(); + let mut a_nonref = Clone::clone(a); nativeGraphSyncError::LightningError ( *unsafe { Box::from_raw(a_nonref.take_inner()) }, ) @@ -56,7 +56,7 @@ impl GraphSyncError { match self { GraphSyncError::DecodeError (mut a, ) => { nativeGraphSyncError::DecodeError ( - *unsafe { Box::from_raw(a.take_inner()) }, + a.into_native(), ) }, GraphSyncError::LightningError (mut a, ) => { @@ -70,13 +70,13 @@ impl GraphSyncError { pub(crate) fn from_native(native: &nativeGraphSyncError) -> Self { match native { nativeGraphSyncError::DecodeError (ref a, ) => { - let mut a_nonref = (*a).clone(); + let mut a_nonref = Clone::clone(a); GraphSyncError::DecodeError ( - crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(a_nonref), is_owned: true }, + crate::lightning::ln::msgs::DecodeError::native_into(a_nonref), ) }, nativeGraphSyncError::LightningError (ref a, ) => { - let mut a_nonref = (*a).clone(); + let mut a_nonref = Clone::clone(a); GraphSyncError::LightningError ( crate::lightning::ln::msgs::LightningError { inner: ObjOps::heap_alloc(a_nonref), is_owned: true }, ) @@ -88,7 +88,7 @@ impl GraphSyncError { match native { nativeGraphSyncError::DecodeError (mut a, ) => { GraphSyncError::DecodeError ( - crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(a), is_owned: true }, + crate::lightning::ln::msgs::DecodeError::native_into(a), ) }, nativeGraphSyncError::LightningError (mut a, ) => {