tokio-timer icon indicating copy to clipboard operation
tokio-timer copied to clipboard

Consider adding extension traits for ergonomics

Open shepmaster opened this issue 7 years ago • 0 comments

Instead of e.g.

let consumer = timer
    .timeout_stream(socket, Duration::from_secs(2))
    .filter(|&v| v == 2)

I think that preserving the chaining of the future or stream would look better:

let consumer = socket
    .timeout(&timer, Duration::from_secs(2))
    .filter(|&v| v == 2)

Note that this allows dropping the _stream from the name.

shepmaster avatar Feb 07 '18 16:02 shepmaster