summaryrefslogtreecommitdiffstats
path: root/tokio/src/stream
diff options
context:
space:
mode:
authorAlice Ryhl <alice@ryhl.io>2020-05-21 11:54:52 +0200
committerGitHub <noreply@github.com>2020-05-21 11:54:52 +0200
commit7cb5e3460c67bdfbe29fb6abf02e2d3cfc13625e (patch)
tree4fb365e4eaf6a5654218a87d3e6801a127e68dfa /tokio/src/stream
parent9b81580be67f6bb0ba87d6f82afcab05795ef21e (diff)
stream: update StreamExt::merge doc (#2520)
Diffstat (limited to 'tokio/src/stream')
-rw-r--r--tokio/src/stream/mod.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/tokio/src/stream/mod.rs b/tokio/src/stream/mod.rs
index 22cba8ee..f97bddb9 100644
--- a/tokio/src/stream/mod.rs
+++ b/tokio/src/stream/mod.rs
@@ -192,12 +192,17 @@ pub trait StreamExt: Stream {
/// Values are produced from the merged stream in the order they arrive from
/// the two source streams. If both source streams provide values
/// simultaneously, the merge stream alternates between them. This provides
- /// some level of fairness.
+ /// some level of fairness. You should not chain calls to `merge`, as this
+ /// will break the fairness of the merging.
///
/// The merged stream completes once **both** source streams complete. When
/// one source stream completes before the other, the merge stream
/// exclusively polls the remaining stream.
///
+ /// For merging multiple streams, consider using [`StreamMap`] instead.
+ ///
+ /// [`StreamMap`]: crate::stream::StreamMap
+ ///
/// # Examples
///
/// ```
@@ -303,7 +308,7 @@ pub trait StreamExt: Stream {
/// As values of this stream are made available, the provided function will
/// be run on them. If the predicate `f` resolves to
/// [`Some(item)`](Some) then the stream will yield the value `item`, but if
- /// it resolves to [`None`], then the value value will be skipped.
+ /// it resolves to [`None`], then the value will be skipped.
///
/// Note that this function consumes the stream passed into it and returns a
/// wrapped version of it, similar to [`Iterator::filter_map`] method in the