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(()) }