Closed GnomedDev closed 4 months ago
Hey, @taiki-e, just letting you know I responded to your review comment.
This is particularly useful in avoiding a heap allocation when a library needs
Pin<Box<dyn Future<Output<T>>>
I think adding this statement to the document would be helpful.
Currently, there is no easy way to wrap a given value in a zst future, so this PR adds one. The
always_ready
function has to take a closure to allow it to yield non-zsts without having to carry around it's size.This is particularly useful in avoiding a heap allocation when a library needs
Pin<Box<dyn Future<Output<T>>>
, as a simple empty async block still has to allocate a boolean in this example for "has been polled".