rustasync / runtime

Empowering everyone to build asynchronous software
https://docs.rs/runtime
Apache License 2.0
862 stars 28 forks source link

Impl Future for Timeout polls itself instead of self.delay #53

Closed kbleeke closed 5 years ago

kbleeke commented 5 years ago

https://github.com/rustasync/runtime/blob/33306fbc6eaae625feba73f6b42e6a4f89f27367/src/time/ext.rs#L31 I think this implementation calls Pin::get_mut and then polls itself, instead of polling self.delay. Or am I missing a get_mut implementation somewhere?

sdroege commented 5 years ago

I think you're right, compare also with the implementation of poll for the TimeoutStream.

Do you want to send a PR for that?