-
Notifications
You must be signed in to change notification settings - Fork 341
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::size_hint #128
Comments
Could you explain the value of |
@taiki-e I feel its mostly API consistency? Though with iter size hint it's useful when pre-allocating structures. For example when using |
The problem is that |
IMO, we should wait for the upstream to add size_hint, instead of adding such a “useless API”. |
@taiki-e ah yeah, fair point. Though I don't disagree, I do see value in implementing all APIs sooner rather than later though. This way we can have the external API that folks can call, which can be incorporated in app logic — and later when we fix the impl nobody needs to rewrite their code. Or well, that's the theory. |
Yay, rust-lang/futures-rs#1853 landed! |
We're now blocked on |
Sweet, this has landed! This means we can now rely on cc/ @sunjay |
Equal to https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.size_hint. Don't think this needs to be marked
async
. This would've been useful to calculate the right pre-alloc size for callingcollect
into a vec in #125. Thanks!The text was updated successfully, but these errors were encountered: