Skip to content

Commit 74ff5a1

Browse files
authored
futures_util::stream::SelectAll::push should use &self. (#2293)
FuturesUnordered::push bound is &self, so SelectAll should be able to use the same bound.
1 parent 9f40e6c commit 74ff5a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

futures-util/src/stream/select_all.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<St: Stream + Unpin> SelectAll<St> {
6161
/// function will not call `poll` on the submitted stream. The caller must
6262
/// ensure that `SelectAll::poll` is called in order to receive task
6363
/// notifications.
64-
pub fn push(&mut self, stream: St) {
64+
pub fn push(&self, stream: St) {
6565
self.inner.push(stream.into_future());
6666
}
6767
}
@@ -119,7 +119,7 @@ pub fn select_all<I>(streams: I) -> SelectAll<I::Item>
119119
where I: IntoIterator,
120120
I::Item: Stream + Unpin
121121
{
122-
let mut set = SelectAll::new();
122+
let set = SelectAll::new();
123123

124124
for stream in streams {
125125
set.push(stream);

0 commit comments

Comments
 (0)