Skip to content

Commit 3f1a50d

Browse files
authored
Merge pull request #103 from alexanderwiederin/refactor-block-hash-ref
refactor(core): move BlockHash::as_ref implementation to main impl block
2 parents af6d0ac + 63ece47 commit 3f1a50d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/core/block.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ impl BlockHash {
6060
Ok(BlockHash { inner })
6161
}
6262
}
63+
64+
pub fn as_ref(&self) -> BlockHashRef<'_> {
65+
unsafe { BlockHashRef::from_ptr(self.inner as *const _) }
66+
}
6367
}
6468

6569
impl AsPtr<btck_BlockHash> for BlockHash {
@@ -272,12 +276,6 @@ impl Block {
272276
}
273277
}
274278

275-
impl BlockHash {
276-
pub fn as_ref(&self) -> BlockHashRef<'_> {
277-
unsafe { BlockHashRef::from_ptr(self.inner as *const _) }
278-
}
279-
}
280-
281279
impl AsPtr<btck_Block> for Block {
282280
fn as_ptr(&self) -> *const btck_Block {
283281
self.inner as *const _

0 commit comments

Comments
 (0)