Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Gjengset <jon@thesquareplanet.com>
  • Loading branch information
taiki-e and jonhoo committed Feb 6, 2022
1 parent d4eebb4 commit dd86ee1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions futures-util/src/stream/futures_unordered/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ impl<Fut: Future> Stream for FuturesUnordered<Fut> {
// deallocating the task if need be.
let res = {
let task = bomb.task.as_ref().unwrap();
// We are only interested in whether the future waken before it
// We are only interested in whether the future is awoken before it
// finishes polling, so reset the flag here.
task.woken.store(false, Relaxed);
let waker = Task::waker_ref(task);
Expand All @@ -517,8 +517,8 @@ impl<Fut: Future> Stream for FuturesUnordered<Fut> {
match res {
Poll::Pending => {
let task = bomb.task.take().unwrap();
// If the future waken before it finishes polling, we assume
// the future yields.
// If the future was awoken during polling, we assume
// the future wanted to explicitly yield.
let yielded = task.woken.load(Relaxed);
bomb.queue.link(task);

Expand Down

0 comments on commit dd86ee1

Please sign in to comment.