From c3f9ab67711b79202726fa19f92538ed00a21e0b Mon Sep 17 00:00:00 2001 From: Dmitry Markin Date: Fri, 25 Aug 2023 18:00:58 +0300 Subject: [PATCH] minor: docs --- substrate/client/network/sync/src/futures_stream.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/substrate/client/network/sync/src/futures_stream.rs b/substrate/client/network/sync/src/futures_stream.rs index e8f42be68b8d..f1d9a4f1191a 100644 --- a/substrate/client/network/sync/src/futures_stream.rs +++ b/substrate/client/network/sync/src/futures_stream.rs @@ -25,7 +25,7 @@ use std::{ task::{Context, Poll, Waker}, }; -/// Receiving side of the futures stream. +/// Wrapper around [`FuturesUnordered`] that wakes a task up automatically. pub struct FuturesStream { futures: FuturesUnordered, waker: Option, @@ -39,7 +39,7 @@ impl Default for FuturesStream { } impl FuturesStream { - /// Push a futures for processing. + /// Push a future for processing. pub fn push(&mut self, future: F) { self.futures.push(future); @@ -48,7 +48,7 @@ impl FuturesStream { } } - /// The number of futures in the sytream. + /// The number of futures in the stream. pub fn len(&self) -> usize { self.futures.len() } @@ -73,7 +73,7 @@ mod tests { use super::*; use futures::future::{BoxFuture, FutureExt}; - /// [`Stream`] implementation for [`FuturesStreamReceiver`] relies on the undocumented + /// [`Stream`] implementation for [`FuturesStream`] relies on the undocumented /// feature that [`FuturesUnordered`] can be polled and repeatedly yield /// `Poll::Ready(None)` before any futures are added into it. #[tokio::test] @@ -89,7 +89,7 @@ mod tests { .await; } - /// [`Stream`] implementation for [`FuturesStreamReceiver`] relies on the undocumented + /// [`Stream`] implementation for [`FuturesStream`] relies on the undocumented /// feature that [`FuturesUnordered`] can be polled and repeatedly yield /// `Poll::Ready(None)` after all the futures in it have resolved. #[tokio::test]