delete compat worker
This commit is contained in:
parent
b760a4bc65
commit
8043862c99
@ -120,31 +120,6 @@ impl<Task:Send+'static> QNWorker<Task>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CompatCRWorker<Task,Value:Clone,F>{
|
|
||||||
data:std::marker::PhantomData<Task>,
|
|
||||||
f:F,
|
|
||||||
value:Value,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<Task,Value:Clone,F:FnMut(Task)->Value> CompatCRWorker<Task,Value,F>{
|
|
||||||
pub fn new(value:Value,f:F) -> Self {
|
|
||||||
Self {
|
|
||||||
f,
|
|
||||||
value,
|
|
||||||
data:std::marker::PhantomData,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn send(&mut self,task:Task)->Result<(),()>{
|
|
||||||
self.value=(self.f)(task);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn grab_clone(&self)->Value{
|
|
||||||
self.value.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]//How to run this test with printing: cargo test --release -- --nocapture
|
#[test]//How to run this test with printing: cargo test --release -- --nocapture
|
||||||
fn test_worker() {
|
fn test_worker() {
|
||||||
println!("hiiiii");
|
println!("hiiiii");
|
||||||
|
Loading…
Reference in New Issue
Block a user