X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_rapid_gossip_sync%2Ferror.rs;h=4a768399bebc6f3ad93a18d88151ef5e0ebcc8cd;hb=3e46e1794f14640e35f09cc6da4169c152de34ce;hp=0fe5716afaeaa3d6e95e0b5148cc18112aba7a26;hpb=a21177846ed75d66f68a1603f768410f07a65791;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 0fe5716..4a76839 100644 --- a/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs +++ b/lightning-c-bindings/src/lightning_rapid_gossip_sync/error.rs @@ -9,6 +9,7 @@ /// Error types that these functions can return use alloc::str::FromStr; +use alloc::string::String; use core::ffi::c_void; use core::convert::Infallible; use bitcoin::hashes::Hash; @@ -38,13 +39,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 ( 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()) }, ) @@ -70,13 +71,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::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 }, )