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

try_filter_map causes stream to panic after an error is returned #2249

Closed
Kouzukii opened this issue Oct 31, 2020 · 2 comments · Fixed by #2250
Closed

try_filter_map causes stream to panic after an error is returned #2249

Kouzukii opened this issue Oct 31, 2020 · 2 comments · Fixed by #2250
Assignees
Labels
A-stream Area: futures::stream bug

Comments

@Kouzukii
Copy link

When try_filter_map() is used on a Stream of Results and an Error is returned, the stream becomes unusable.
Calling .next() on it afterwards results in a panic.

Related discussion on the rust forums: https://users.rust-lang.org/t/take-first-non-error-result-out-of-a-stream-of-results-in-rust/50897

Playground to reproduce the bug: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=82e01c4891d60df13a12528451d12225

@taiki-e
Copy link
Member

taiki-e commented Oct 31, 2020

Good catch! Seems there are the same bugs in try_skip_while and try_take_while.

@taiki-e
Copy link
Member

taiki-e commented Oct 31, 2020

Filed #2250 to fix this.

@taiki-e taiki-e added the A-stream Area: futures::stream label Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants