Skip to content

Add Stream::zip #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2019
Merged

Add Stream::zip #204

merged 1 commit into from
Sep 17, 2019

Conversation

tirr-c
Copy link
Contributor

@tirr-c tirr-c commented Sep 17, 2019

No description provided.

}
}

impl<A: Unpin + Stream, B: Unpin> Unpin for Zip<A, B> {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
impl<A: Unpin + Stream, B: Unpin> Unpin for Zip<A, B> {}
impl<A: Unpin, B: Unpin> Unpin for Zip<A, B> {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work because of A: Stream bound on struct Zip.

///
/// let l: VecDeque<isize> = vec![1, 2, 3].into_iter().collect();
/// let r: VecDeque<isize> = vec![4, 5, 6, 7].into_iter().collect();
/// let mut s = l.zip(r);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused - how does this work? Are l and r streams or VecDeques here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VecDeques implement futures::stream::Stream so they work as streams.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@ghost
Copy link

ghost commented Sep 17, 2019

bors r+

bors bot added a commit that referenced this pull request Sep 17, 2019
204: Add Stream::zip r=stjepang a=tirr-c



Co-authored-by: Wonwoo Choi <chwo9843@gmail.com>
@bors
Copy link
Contributor

bors bot commented Sep 17, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 73db46c into async-rs:master Sep 17, 2019
@yoshuawuyts
Copy link
Contributor

Ref #129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants