Skip to content

Commit cf05085

Browse files
authored
Merge pull request #95 from alexanderwiederin/refactor-context-as-ptr
Refactor(state): Make Context::as_ptr internal using sealed trait
2 parents 05402db + 6a26782 commit cf05085

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/state/context.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use libbitcoinkernel_sys::{
1010
};
1111

1212
use crate::{
13-
ffi::c_helpers,
13+
ffi::{c_helpers, sealed::AsPtr},
1414
notifications::{
1515
notification::{
1616
notification_block_tip_wrapper, notification_fatal_error_wrapper,
@@ -87,9 +87,11 @@ impl Context {
8787
));
8888
}
8989
}
90+
}
9091

91-
pub fn as_ptr(&self) -> *mut btck_Context {
92-
self.inner
92+
impl AsPtr<btck_Context> for Context {
93+
fn as_ptr(&self) -> *const btck_Context {
94+
self.inner as *const _
9395
}
9496
}
9597

0 commit comments

Comments
 (0)