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

Collect/TryCollect does not use Stream::size_hint #2617

Closed
jhgg opened this issue Jul 1, 2022 · 1 comment
Closed

Collect/TryCollect does not use Stream::size_hint #2617

jhgg opened this issue Jul 1, 2022 · 1 comment
Labels
A-stream Area: futures::stream C-question

Comments

@jhgg
Copy link

jhgg commented Jul 1, 2022

I was reading through the implementation of collect/try_collect, and realized that the size_hint of the stream was not being used. Is there any good reason for this, or is this just a bug/not yet implemented?

@taiki-e
Copy link
Member

taiki-e commented Jul 2, 2022

In the current API, unstable Extend::extend_reserve (rust-lang/rust#72631) is needed to use size_hint. See also #1833.

@taiki-e taiki-e closed this as completed Jul 2, 2022
@taiki-e taiki-e added C-question A-stream Area: futures::stream labels Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stream Area: futures::stream C-question
Projects
None yet
Development

No branches or pull requests

2 participants