fix compat worker
This commit is contained in:
parent
5d9308eccc
commit
657e5dff7f
@ -7,14 +7,14 @@ pub struct CompatNWorker<Task>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<Task> CompatNWorker<Task>{
|
impl<Task> CompatNWorker<Task>{
|
||||||
pub fn new(f:impl FnMut(Task))->Self{
|
pub fn new(f:impl FnMut(Task)+'static)->Self{
|
||||||
Self{
|
Self{
|
||||||
data:std::marker::PhantomData,
|
data:std::marker::PhantomData,
|
||||||
f:Box::new(f),
|
f:Box::new(f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send(&self,task:Task)->Result<(),()>{
|
pub fn send(&mut self,task:Task)->Result<(),()>{
|
||||||
(self.f)(task);
|
(self.f)(task);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user