Skip to content

Commit

Permalink
doc: fix some doctests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tvallotton committed Jan 20, 2024
1 parent 038c6e0 commit 180c68b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
/// // we exit, since there are no more tasks remaining on the queue
/// return;
/// };
/// let waker = Waker::noop();
///
/// // cast the Rc<Task> into a `LocalWaker`
/// let local_waker: LocalWaker = task.clone().into();
/// // Build the context using `ContextBuilder`
/// let mut cx = ContextBuilder::from_waker(&waker)
/// let mut cx = ContextBuilder::from_waker(Waker::noop())
/// .local_waker(&local_waker)
/// .build();
///
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,14 @@ impl LocalWaker {
/// #![feature(noop_waker)]
///
/// use std::future::Future;
/// use std::task::{ContextBuilder, LocalWaker};
/// use std::task::{ContextBuilder, LocalWaker, Waker, Poll};
///
/// let mut cx = task::ContextBuilder::from_waker(Waker::noop())
/// let mut cx = ContextBuilder::from_waker(Waker::noop())
/// .local_waker(LocalWaker::noop())
/// .build();
///
/// let mut future = Box::pin(async { 10 });
/// assert_eq!(future.as_mut().poll(&mut cx), task::Poll::Ready(10));
/// assert_eq!(future.as_mut().poll(&mut cx), Poll::Ready(10));
/// ```
#[inline]
#[must_use]
Expand Down

0 comments on commit 180c68b

Please sign in to comment.