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

Implement stream::poll_fn #545

Merged
merged 2 commits into from
Aug 14, 2017
Merged

Conversation

ishitatsuyuki
Copy link
Contributor

@ishitatsuyuki ishitatsuyuki commented Jul 31, 2017

WIP. Using CI because I'm affected by rust-lang/rust#43132.

EDIT: seems passed.

@ishitatsuyuki ishitatsuyuki force-pushed the stream_pollfn branch 4 times, most recently from e1fb7e7 to ae5685a Compare July 31, 2017 08:10
@alexcrichton
Copy link
Member

Shouldn't this be included in stream/mod.rs as well? Can you be sure to test this patch locally and include a unit test as well?

@ishitatsuyuki
Copy link
Contributor Author

Uh, can't right now. I will have to do a rebuild.

I modified mod.rs initially but I accidentally removed it alongside with whitespace change.

I will address the issues including tests tomorrow.

@ishitatsuyuki
Copy link
Contributor Author

r? @alexcrichton

/// ```
pub fn poll_fn<T, E, F>(f: F) -> PollFn<F>
where
F: FnMut() -> Poll<T, E>,
Copy link
Member

Choose a reason for hiding this comment

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

I think inference may be helped here by having this be Poll<Option<T>, E>, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

@alexcrichton alexcrichton merged commit 10e48d8 into rust-lang:master Aug 14, 2017
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.

None yet

2 participants