diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2024-07-22 17:35:11 +0100 |
|---|---|---|
| committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2024-07-22 18:07:28 +0100 |
| commit | c404406a87412d50604893d8c347744195ce2dea (patch) | |
| tree | 66428e724e4387114b7306d9f8dcdd3013c12dd4 | |
| parent | b18c7d85a92011bcc094b33e6a3c646a3cfca8f3 (diff) | |
| download | rust-c404406a87412d50604893d8c347744195ce2dea.tar.gz rust-c404406a87412d50604893d8c347744195ce2dea.zip | |
LocalWaker docs: Make long-ago omitted but probably intended changes
In 6f8a944ba4311cbcf5922132721095c226c6fbab, 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.
| -rw-r--r-- | library/core/src/task/wake.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index 4582bf9f422..baa8a956f8a 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -786,7 +786,7 @@ impl LocalWaker { Self { waker } } - /// Creates a new `LocalWaker` that does nothing when `wake` is called. + /// Returns a reference to a `LocalWaker` that does nothing when used. /// // Note! Much of the documentation for this method is duplicated // in the docs for `Waker::noop`. @@ -796,6 +796,8 @@ impl LocalWaker { /// some futures, but are not expecting those futures to wake the waker or /// do not need to do anything specific if it happens. /// + /// If an owned `LocalWaker` is needed, `clone()` this one. + /// /// # Examples /// /// ``` |
