docs: use third form in API docs (#2027)

This commit is contained in:
Oleg Nosov
2020-01-24 09:31:13 -08:00
committed by Carl Lerche
parent a70f7203a4
commit f9ddb93604
83 changed files with 288 additions and 278 deletions
+6 -7
View File
@@ -45,7 +45,7 @@ const WAKE: usize = 1;
const SLEEP: usize = 2;
impl<T> Spawn<T> {
/// Consume `self` returning the inner value
/// Consumes `self` returning the inner value
pub fn into_inner(mut self) -> T
where
T: Unpin,
@@ -101,7 +101,7 @@ impl<T: Unpin> ops::DerefMut for Spawn<T> {
}
impl<T: Future> Spawn<T> {
/// Poll a future
/// Polls a future
pub fn poll(&mut self) -> Poll<T::Output> {
let fut = self.future.as_mut();
self.task.enter(|cx| fut.poll(cx))
@@ -109,7 +109,7 @@ impl<T: Future> Spawn<T> {
}
impl<T: Stream> Spawn<T> {
/// Poll a stream
/// Polls a stream
pub fn poll_next(&mut self) -> Poll<Option<T::Item>> {
let stream = self.future.as_mut();
self.task.enter(|cx| stream.poll_next(cx))
@@ -117,14 +117,14 @@ impl<T: Stream> Spawn<T> {
}
impl MockTask {
/// Create a new mock task
/// Creates new mock task
fn new() -> Self {
MockTask {
waker: Arc::new(ThreadWaker::new()),
}
}
/// Run a closure from the context of the task.
/// Runs a closure from the context of the task.
///
/// Any wake notifications resulting from the execution of the closure are
/// tracked.
@@ -190,8 +190,7 @@ impl ThreadWaker {
}
fn wake(&self) {
// First, try transitioning from IDLE -> NOTIFY, this does not require a
// lock.
// First, try transitioning from IDLE -> NOTIFY, this does not require a lock.
let mut state = self.state.lock().unwrap();
let prev = *state;