diff options
| author | Yoshua Wuyts <yoshuawuyts@gmail.com> | 2020-07-14 11:59:11 +0200 |
|---|---|---|
| committer | Yoshua Wuyts <yoshuawuyts@gmail.com> | 2020-07-14 11:59:11 +0200 |
| commit | 0e9a20f311c7816b8ac4e92f487ce95b813ce6f6 (patch) | |
| tree | 0397914c5233076ad1d0adb240ba653e67e32491 | |
| parent | 4a689da944977496fb758cc2d700984cc6a10b7f (diff) | |
| download | rust-0e9a20f311c7816b8ac4e92f487ce95b813ce6f6.tar.gz rust-0e9a20f311c7816b8ac4e92f487ce95b813ce6f6.zip | |
Remove unnecessary type hints from the Wake impl
| -rw-r--r-- | src/liballoc/task.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liballoc/task.rs b/src/liballoc/task.rs index 0d1cc99df47..252e04a4105 100644 --- a/src/liballoc/task.rs +++ b/src/liballoc/task.rs @@ -69,14 +69,13 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker { // Wake by value, moving the Arc into the Wake::wake function unsafe fn wake<W: Wake + Send + Sync + 'static>(waker: *const ()) { - let waker: Arc<W> = unsafe { Arc::from_raw(waker as *const W) }; + let waker = unsafe { Arc::from_raw(waker as *const W) }; <W as Wake>::wake(waker); } // Wake by reference, wrap the waker in ManuallyDrop to avoid dropping it unsafe fn wake_by_ref<W: Wake + Send + Sync + 'static>(waker: *const ()) { - let waker: ManuallyDrop<Arc<W>> = - unsafe { ManuallyDrop::new(Arc::from_raw(waker as *const W)) }; + let waker = unsafe { ManuallyDrop::new(Arc::from_raw(waker as *const W)) }; <W as Wake>::wake_by_ref(&waker); } |
