Skip to content
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

Add Stream::flatten and Stream::flat_map #367

Merged
merged 28 commits into from Oct 29, 2019

Conversation

k-nasa
Copy link
Member

@k-nasa k-nasa commented Oct 18, 2019

Implement Stream::flatten and Stream::flat_map

スクリーンショット 2019-10-26 0 26 45

スクリーンショット 2019-10-26 0 26 34

ref: #129

@k-nasa
Copy link
Member Author

k-nasa commented Oct 25, 2019

The review is ready. Can you see it if you like? @stjepang

@k-nasa k-nasa marked this pull request as ready for review October 25, 2019 15:51
src/lib.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
k-nasa and others added 6 commits October 26, 2019 01:42
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
@k-nasa k-nasa requested a review from taiki-e October 25, 2019 16:50
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
src/stream/stream/flatten.rs Outdated Show resolved Hide resolved
k-nasa and others added 3 commits October 27, 2019 12:35
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
@k-nasa
Copy link
Member Author

k-nasa commented Oct 27, 2019

@taiki-e Thanks for review ‼️

@k-nasa k-nasa requested a review from taiki-e October 27, 2019 09:20
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

This PR is looking really good! -- left a comment on code structure, but feel this is very good already!

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.project().inner.poll_next(cx)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of exporting flatten::{Flatten, FlatMap} I think it'd be preferable to export them from separate files.

The FlattenCompat is a nice idea, but I'm generally wary of introducing abstractions here, preferring to duplicate some of the logic instead. While this is more lines of code, it's also somewhat simpler. Would you be okay with splitting the two impls into two files, and removing the shared FlattenCompat struct?

Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yh!

@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Oct 28, 2019
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

yay, thanks!

@yoshuawuyts yoshuawuyts merged commit 1175a37 into async-rs:master Oct 29, 2019
@k-nasa k-nasa deleted the add_stream_flatten branch October 29, 2019 01:25
@k-nasa
Copy link
Member Author

k-nasa commented Oct 29, 2019

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants