Skip to content

Commit d10af07

Browse files
committed
futures_util::stream::SelectAll::push should use &self.
FuturesUnordered::push bound is &self, so SelectAll should be able to use the same bound.
1 parent 8a04b51 commit d10af07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

futures-util/src/stream/select_all.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<St: Stream + Unpin> SelectAll<St> {
6060
/// function will not call `poll` on the submitted stream. The caller must
6161
/// ensure that `SelectAll::poll` is called in order to receive task
6262
/// notifications.
63-
pub fn push(&mut self, stream: St) {
63+
pub fn push(&self, stream: St) {
6464
self.inner.push(stream.into_future());
6565
}
6666
}
@@ -118,7 +118,7 @@ pub fn select_all<I>(streams: I) -> SelectAll<I::Item>
118118
where I: IntoIterator,
119119
I::Item: Stream + Unpin
120120
{
121-
let mut set = SelectAll::new();
121+
let set = SelectAll::new();
122122

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

0 commit comments

Comments
 (0)