diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-14 07:39:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-14 07:39:17 -0700 |
| commit | 2fb307aca5b4ac317b09c7e91a8d4259fbebf17a (patch) | |
| tree | 7eab5beac149a305437e7a574752e66a4837456d /src/liballoc | |
| parent | 99c0b9764a6da35fdcb0bb08beaa18f7a3e0224a (diff) | |
| parent | 0e9a20f311c7816b8ac4e92f487ce95b813ce6f6 (diff) | |
| download | rust-2fb307aca5b4ac317b09c7e91a8d4259fbebf17a.tar.gz rust-2fb307aca5b4ac317b09c7e91a8d4259fbebf17a.zip | |
Rollup merge of #74316 - yoshuawuyts:no-wake-type-hints, r=Mark-Simulacrum
Remove unnecessary type hints from Wake internals While working on https://github.com/rust-lang/rust/pull/74304 I noticed we were writing out the type signature twice in some internal `Wake` impl methods; this streamlines that. Thanks!
Diffstat (limited to 'src/liballoc')
| -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); } |
