Skip to content

Support ? operator in async stream (add async_try_stream) #2

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

Closed
taiki-e opened this issue Jul 31, 2019 · 1 comment · Fixed by #15
Closed

Support ? operator in async stream (add async_try_stream) #2

taiki-e opened this issue Jul 31, 2019 · 1 comment · Fixed by #15
Labels
C-enhancement Category: A new feature or an improvement for an existing one

Comments

@taiki-e
Copy link
Owner

taiki-e commented Jul 31, 2019

Unlike futures-await, we cannot use ? operator in async_stream. It would be useful if we had more sugar for this.

#[async_try_stream(ok = String, error = io::Error)]
fn fetch_all(client: hyper::Client, urls: Vec<&'static str>) {
    for url in urls {
         yield fetch(client, url).await?;
    }
}

Related: rust-lang/futures-rs#1548 (comment)

@taiki-e taiki-e changed the title Support ? in async stream Support ? operator in async stream Jul 31, 2019
@taiki-e taiki-e changed the title Support ? operator in async stream Support ? operator in async stream (add async_try_stream) Aug 3, 2019
@taiki-e
Copy link
Owner Author

taiki-e commented Aug 21, 2019

Filed #15

@bors bors bot closed this as completed in 177ad4c Sep 6, 2019
@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant