Skip to content

Commit 256115e

Browse files
author
Stjepan Glavina
committed
Document the return value of run()
1 parent 7e1581a commit 256115e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/runnable.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,10 @@ impl Runnable {
276276
/// Runs the task by polling its future.
277277
///
278278
/// Returns `true` if the task was woken while running, in which case the [`Runnable`] gets
279-
/// rescheduled at the end of this method invocation.
280-
///
281-
/// Otherwise, returns `true` and the [`Runnable`] vanishes until the task is woken.
279+
/// rescheduled at the end of this method invocation. Otherwise, returns `false` and the
280+
/// [`Runnable`] vanishes until the task is woken.
281+
/// The return value is just a hint: `true` usually indicates that the task has yielded, i.e.
282+
/// it woke itself and then gave the control back to the executor.
282283
///
283284
/// If the [`Task`] handle was dropped or if [`cancel()`][`Task::cancel()`] was called, then
284285
/// this method simply destroys the task.

0 commit comments

Comments
 (0)