forked from StrafesNET/strafe-client
fix compat worker
This commit is contained in:
parent
5d9308eccc
commit
657e5dff7f
@ -7,14 +7,14 @@ pub struct CompatNWorker<Task>{
|
||||
}
|
||||
|
||||
impl<Task> CompatNWorker<Task>{
|
||||
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(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user