From 048201b77eab29aa899070da921aaf5d062e168a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Sat, 22 Aug 2020 00:51:14 +0200 Subject: [PATCH] Impl task::Wake for Fn --- library/alloc/src/task.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/alloc/src/task.rs b/library/alloc/src/task.rs index 5edc579605669..4d32d3f120e8b 100644 --- a/library/alloc/src/task.rs +++ b/library/alloc/src/task.rs @@ -87,3 +87,13 @@ fn raw_waker(waker: Arc) -> RawWaker { &RawWakerVTable::new(clone_waker::, wake::, wake_by_ref::, drop_waker::), ) } + +impl Wake for F { + fn wake(self: Arc) { + (self)(); + } + + fn wake_by_ref(self: &Arc) { + (self)(); + } +}