X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fln%2Ffeatures.rs;h=06dc42020a1d1509c2137e2a2c3b74d76e6ad693;hb=f1b4534aad1b6d36be7312710681ca92c0479ae7;hp=71adebeb5725210808a956616cc8fa71e0641575;hpb=14441a092648bd628a260c2c7975c223aec7640f;p=rust-lightning diff --git a/lightning-c-bindings/src/ln/features.rs b/lightning-c-bindings/src/ln/features.rs index 71adebeb..06dc4202 100644 --- a/lightning-c-bindings/src/ln/features.rs +++ b/lightning-c-bindings/src/ln/features.rs @@ -23,7 +23,7 @@ use crate::c_types::*; impl Clone for InitFeatures { fn clone(&self) -> Self { Self { - inner: if self.inner.is_null() { std::ptr::null_mut() } else { + inner: if <*mut nativeInitFeatures>::is_null(self.inner) { std::ptr::null_mut() } else { Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) }, is_owned: true, } @@ -41,7 +41,7 @@ pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures { impl Clone for NodeFeatures { fn clone(&self) -> Self { Self { - inner: if self.inner.is_null() { std::ptr::null_mut() } else { + inner: if <*mut nativeNodeFeatures>::is_null(self.inner) { std::ptr::null_mut() } else { Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) }, is_owned: true, } @@ -59,7 +59,7 @@ pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures { impl Clone for ChannelFeatures { fn clone(&self) -> Self { Self { - inner: if self.inner.is_null() { std::ptr::null_mut() } else { + inner: if <*mut nativeChannelFeatures>::is_null(self.inner) { std::ptr::null_mut() } else { Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) }, is_owned: true, } @@ -90,7 +90,7 @@ pub struct InitFeatures { impl Drop for InitFeatures { fn drop(&mut self) { - if self.is_owned && !self.inner.is_null() { + if self.is_owned && !<*mut nativeInitFeatures>::is_null(self.inner) { let _ = unsafe { Box::from_raw(self.inner) }; } } @@ -128,7 +128,7 @@ pub struct NodeFeatures { impl Drop for NodeFeatures { fn drop(&mut self) { - if self.is_owned && !self.inner.is_null() { + if self.is_owned && !<*mut nativeNodeFeatures>::is_null(self.inner) { let _ = unsafe { Box::from_raw(self.inner) }; } } @@ -166,7 +166,7 @@ pub struct ChannelFeatures { impl Drop for ChannelFeatures { fn drop(&mut self) { - if self.is_owned && !self.inner.is_null() { + if self.is_owned && !<*mut nativeChannelFeatures>::is_null(self.inner) { let _ = unsafe { Box::from_raw(self.inner) }; } }