diff --git a/src/hook.rs b/src/hook.rs index de3a220..7c53848 100644 --- a/src/hook.rs +++ b/src/hook.rs @@ -1,8 +1,7 @@ -use core::sync::atomic::{AtomicPtr, Ordering}; use core::ptr::null_mut; +use core::sync::atomic::{AtomicPtr, Ordering}; pub trait Hook: Copy { - fn hook(&self) -> HookGuard { let self_ptr = self.as_ptr_u8(); @@ -44,7 +43,7 @@ where fn trampoline(f: F) -> Closure { unsafe extern "C" fn thunk() where - F: FnMut(), + F: FnMut() + 'static, { let p = STATIC_CONTEXT.swap(null_mut(), Ordering::Relaxed) as *mut ClosureInner; ((*p).data)();