Skip to content

Commit 01a704c

Browse files
CentrilMatthias247
andcommitted
Apply suggestions from code review
Co-Authored-By: Matthias247 <matthias.einwag@live.com>
1 parent d9a4b22 commit 01a704c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/libcore/task/wake.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ use marker::Unpin;
88
/// A `RawWaker` allows the implementor of a task executor to create a `Waker`
99
/// which provides customized wakeup behavior.
1010
///
11-
/// It consists of a data pointer and a virtual function pointer table (vtable) that
11+
/// [vtable]: https://en.wikipedia.org/wiki/Virtual_method_table
12+
///
13+
/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
1214
/// customizes the behavior of the `RawWaker`.
1315
#[derive(PartialEq)]
1416
pub struct RawWaker {
1517
/// A data pointer, which can be used to store arbitrary data as required
1618
/// by the executor. This could be e.g. a type-erased pointer to an `Arc`
1719
/// that is associated with the task.
1820
/// The value of this field gets passed to all functions that are part of
19-
/// the vtable as first parameter.
21+
/// the vtable as the first parameter.
2022
pub data: *const (),
2123
/// Virtual function pointer table that customizes the behavior of this waker.
2224
pub vtable: &'static RawWakerVTable,
@@ -30,7 +32,7 @@ impl fmt::Debug for RawWaker {
3032
}
3133

3234
/// A virtual function pointer table (vtable) that specifies the behavior
33-
/// of a `RawWaker`.
35+
/// of a [`RawWaker`].
3436
///
3537
/// The pointer passed to all functions inside the vtable is the `data` pointer
3638
/// from the enclosing `RawWaker` object.
@@ -105,7 +107,7 @@ impl Waker {
105107
/// contract to make it usable for `Waker` and is therefore unsafe.
106108
pub unsafe fn new_unchecked(waker: RawWaker) -> Waker {
107109
Waker {
108-
waker: waker,
110+
waker,
109111
}
110112
}
111113
}

0 commit comments

Comments
 (0)