From 657e5dff7ff5d71fc4f404504d19297ee6a7e271 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 24 Oct 2023 20:20:13 -0700 Subject: [PATCH] fix compat worker --- src/compat_worker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compat_worker.rs b/src/compat_worker.rs index 1a87005..bf703ba 100644 --- a/src/compat_worker.rs +++ b/src/compat_worker.rs @@ -7,14 +7,14 @@ pub struct CompatNWorker{ } impl CompatNWorker{ - pub fn new(f:impl FnMut(Task))->Self{ + pub fn new(f:impl FnMut(Task)+'static)->Self{ Self{ data:std::marker::PhantomData, f:Box::new(f), } } - pub fn send(&self,task:Task)->Result<(),()>{ + pub fn send(&mut self,task:Task)->Result<(),()>{ (self.f)(task); Ok(()) }