Skip to content

Commit

Permalink
Updating Wake example to use new 'pin!' macro
Browse files Browse the repository at this point in the history
  • Loading branch information
madsravn committed Apr 6, 2023
1 parent f5b8f44 commit 4698b9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/alloc/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use crate::sync::Arc;
/// use std::sync::Arc;
/// use std::task::{Context, Poll, Wake};
/// use std::thread::{self, Thread};
/// use core::pin::pin;
///
/// /// A waker that wakes up the current thread when called.
/// struct ThreadWaker(Thread);
Expand All @@ -52,7 +53,7 @@ use crate::sync::Arc;
/// /// Run a future to completion on the current thread.
/// fn block_on<T>(fut: impl Future<Output = T>) -> T {
/// // Pin the future so it can be polled.
/// let mut fut = Box::pin(fut);
/// let mut fut = pin!(fut);
///
/// // Create a new context to be passed to the future.
/// let t = thread::current();
Expand Down

0 comments on commit 4698b9f

Please sign in to comment.