all: use trait upcasting
This commit is contained in:
parent
f0caafc862
commit
09e5f89174
44 changed files with 90 additions and 269 deletions
|
|
@ -89,7 +89,7 @@ impl CpuWork for ReadWriteWork {
|
|||
}
|
||||
|
||||
fn async_work_done(&mut self, work: Box<dyn AsyncCpuWork>) {
|
||||
let work = work.into_any().downcast().unwrap();
|
||||
let work = (work as Box<dyn Any>).downcast().unwrap();
|
||||
self.config = Some(work);
|
||||
}
|
||||
}
|
||||
|
|
@ -144,8 +144,4 @@ impl AsyncCpuWork for ReadWriteWorkConfig {
|
|||
completion.complete(self)
|
||||
})
|
||||
}
|
||||
|
||||
fn into_any(self: Box<Self>) -> Box<dyn Any> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,10 +71,6 @@ impl AsyncCpuWork for AsyncWork {
|
|||
completion.complete(self)
|
||||
})
|
||||
}
|
||||
|
||||
fn into_any(self: Box<Self>) -> Box<dyn Any> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
fn run(cancel: bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue