diff --git a/src/core/block.rs b/src/core/block.rs index 66820174..e1baedc3 100644 --- a/src/core/block.rs +++ b/src/core/block.rs @@ -60,6 +60,10 @@ impl BlockHash { Ok(BlockHash { inner }) } } + + pub fn as_ref(&self) -> BlockHashRef<'_> { + unsafe { BlockHashRef::from_ptr(self.inner as *const _) } + } } impl AsPtr for BlockHash { @@ -272,12 +276,6 @@ impl Block { } } -impl BlockHash { - pub fn as_ref(&self) -> BlockHashRef<'_> { - unsafe { BlockHashRef::from_ptr(self.inner as *const _) } - } -} - impl AsPtr for Block { fn as_ptr(&self) -> *const btck_Block { self.inner as *const _