Skip to content

Commit 971aa37

Browse files
committed
LocalWaker docs: Make long-ago omitted but probably intended changes
In 6f8a944, titled Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`. the summary line for Waker was changed: - /// Creates a new `Waker` that does nothing when `wake` is called. + /// Returns a reference to a `Waker` that does nothing when used. and the sentence about clone was added. LocalWaker's docs were not changed, even though the types were, but there is no explanation for why not. It seems like it was simply a slip induced by the clone-and-hack.
1 parent c4fdac9 commit 971aa37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: core/src/task/wake.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ impl LocalWaker {
786786
Self { waker }
787787
}
788788

789-
/// Creates a new `LocalWaker` that does nothing when `wake` is called.
789+
/// Returns a reference to a `LocalWaker` that does nothing when used.
790790
///
791791
// Note! Much of the documentation for this method is duplicated
792792
// in the docs for `Waker::noop`.
@@ -796,6 +796,8 @@ impl LocalWaker {
796796
/// some futures, but are not expecting those futures to wake the waker or
797797
/// do not need to do anything specific if it happens.
798798
///
799+
/// If an owned `LocalWaker` is needed, `clone()` this one.
800+
///
799801
/// # Examples
800802
///
801803
/// ```

0 commit comments

Comments
 (0)