diff options
Diffstat (limited to 'tokio-test/src/task.rs')
-rw-r--r-- | tokio-test/src/task.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tokio-test/src/task.rs b/tokio-test/src/task.rs index 71ebe7b4..04328e3d 100644 --- a/tokio-test/src/task.rs +++ b/tokio-test/src/task.rs @@ -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; |