about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-03 12:30:34 -0800
committerMatthias Einwag <matthias.einwag@live.com>2019-02-03 13:46:53 -0800
commit01a704cf3650710a3e3db221759207539de61613 (patch)
tree84bd28f8b59cba5239b6e452cf1d6d820f30409f /src/libcore/task
parentd9a4b22d3291913a8f2158a1b7c195bc30c9286e (diff)
downloadrust-01a704cf3650710a3e3db221759207539de61613.tar.gz
rust-01a704cf3650710a3e3db221759207539de61613.zip
Apply suggestions from code review
Co-Authored-By: Matthias247 <matthias.einwag@live.com>
Diffstat (limited to 'src/libcore/task')
-rw-r--r--src/libcore/task/wake.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs
index bb91bf2ecfb..adaca504345 100644
--- a/src/libcore/task/wake.rs
+++ b/src/libcore/task/wake.rs
@@ -8,7 +8,9 @@ use marker::Unpin;
 /// A `RawWaker` allows the implementor of a task executor to create a `Waker`
 /// which provides customized wakeup behavior.
 ///
-/// It consists of a data pointer and a virtual function pointer table (vtable) that
+/// [vtable]: https://en.wikipedia.org/wiki/Virtual_method_table
+///
+/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
 /// customizes the behavior of the `RawWaker`.
 #[derive(PartialEq)]
 pub struct RawWaker {
@@ -16,7 +18,7 @@ pub struct RawWaker {
     /// by the executor. This could be e.g. a type-erased pointer to an `Arc`
     /// that is associated with the task.
     /// The value of this field gets passed to all functions that are part of
-    /// the vtable as first parameter.
+    /// the vtable as the first parameter.
     pub data: *const (),
     /// Virtual function pointer table that customizes the behavior of this waker.
     pub vtable: &'static RawWakerVTable,
@@ -30,7 +32,7 @@ impl fmt::Debug for RawWaker {
 }
 
 /// A virtual function pointer table (vtable) that specifies the behavior
-/// of a `RawWaker`.
+/// of a [`RawWaker`].
 ///
 /// The pointer passed to all functions inside the vtable is the `data` pointer
 /// from the enclosing `RawWaker` object.
@@ -105,7 +107,7 @@ impl Waker {
     /// contract to make it usable for `Waker` and is therefore unsafe.
     pub unsafe fn new_unchecked(waker: RawWaker) -> Waker {
         Waker {
-            waker: waker,
+            waker,
         }
     }
 }