Skip to content

Commit

Permalink
Docs for Waker and LocalWaker: Add cross-refs in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ijackson committed Jul 22, 2024
1 parent 323e962 commit c4fdac9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ impl Waker {

/// Returns a reference to a `Waker` that does nothing when used.
///
// Note! Much of the documentation for this method is duplicated
// in the docs for `LocalWaker::noop`.
// If you edit it, consider editing the other copy too.
//
/// This is mostly useful for writing tests that need a [`Context`] to poll
/// some futures, but are not expecting those futures to wake the waker or
/// do not need to do anything specific if it happens.
Expand Down Expand Up @@ -784,6 +788,10 @@ impl LocalWaker {

/// Creates a new `LocalWaker` that does nothing when `wake` is called.
///
// Note! Much of the documentation for this method is duplicated
// in the docs for `Waker::noop`.
// If you edit it, consider editing the other copy too.
//
/// This is mostly useful for writing tests that need a [`Context`] to poll
/// some futures, but are not expecting those futures to wake the waker or
/// do not need to do anything specific if it happens.
Expand Down

0 comments on commit c4fdac9

Please sign in to comment.