forked from koniifer/ableos
clippy
This commit is contained in:
parent
aaf840c5b4
commit
87fdb2e0bf
|
@ -91,11 +91,12 @@ impl Executor {
|
|||
panic!("attempted to get non-extant task with id {}", id.0)
|
||||
};
|
||||
|
||||
let mut cx = Context::from_waker(
|
||||
self.wakers
|
||||
.entry(id)
|
||||
.or_insert_with(|| TaskWaker::new(id, Arc::clone(&self.queue))),
|
||||
);
|
||||
let mut cx = Context::from_waker(self.wakers.entry(id).or_insert_with(|| {
|
||||
Waker::from(Arc::new(TaskWaker {
|
||||
id,
|
||||
queue: Arc::clone(&self.queue),
|
||||
}))
|
||||
}));
|
||||
|
||||
match task.poll(&mut cx) {
|
||||
Poll::Ready(()) => {
|
||||
|
@ -137,12 +138,6 @@ struct TaskWaker {
|
|||
queue: TaskQueue,
|
||||
}
|
||||
|
||||
impl TaskWaker {
|
||||
fn new(id: TaskId, queue: TaskQueue) -> Waker {
|
||||
Waker::from(Arc::new(Self { id, queue }))
|
||||
}
|
||||
}
|
||||
|
||||
impl Wake for TaskWaker {
|
||||
fn wake(self: Arc<Self>) {
|
||||
self.wake_by_ref();
|
||||
|
|
Loading…
Reference in a new issue