async-std
async-std copied to clipboard
Implement Stream::size_hint method on stream utilities
Most of async-std's stream utilities were written before Stream::size_hint
was released and do not implement Stream::size_hint
method. This means that async-std's stream utilities may be a bit inefficient than other crates such as futures, tokio-stream, futures-lite, which provide similar utilities.
related: https://github.com/rust-lang/futures-rs/pull/1853, https://github.com/rust-lang/rust/pull/81797
Hey guys I wanted to know if on the size_hint method in the stream trait on the crate, if I should give it a default implementation. Something like below, a default size_hint is implemented in the stream module in the standard library.
fn size_hint(&self) -> (usize, Option
IIRC, this crate's Stream trait is for documentation, so I think either one is fine.
Okay, I'll directly work on the stream size_hint implementation.
PR: https://github.com/async-rs/async-std/pull/967