From b372f6d4bd106fd4dca4b7f10e7be01279e4f76e Mon Sep 17 00:00:00 2001 From: KiraCoding <38864051+KiraCoding@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:09:31 +0200 Subject: [PATCH] wip --- src/hook.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)();