Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-markin committed Aug 28, 2023
1 parent 096c0e0 commit ca546cd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions substrate/client/network/sync/src/futures_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ impl<F: Future> Stream for FuturesStream<F> {
type Item = <F as Future>::Output;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
if let Poll::Ready(Some(result)) = self.futures.poll_next_unpin(cx) {
Poll::Ready(Some(result))
} else {
self.waker = Some(cx.waker().clone());
let Poll::Ready(Some(result)) = self.futures.poll_next_unpin(cx) else {
self.waker = Some(cx.waker().clone());

Poll::Pending
}
}
return Poll::Pending
};

Poll::Ready(Some(result))
}
}

#[cfg(test)]
Expand Down

0 comments on commit ca546cd

Please sign in to comment.