refactor(client): Use async/await more (#2437)
* refactor: Use async/await in client.rs * refactor: Simplify client.rs a bit more * refactor: Allow !Unpin in Lazy * Remove some impl Future * Remove some combinator use
This commit is contained in:
committed by
GitHub
parent
42587059e6
commit
f01de8e503
@@ -192,12 +192,13 @@ impl<B> SendRequest<B> {
|
||||
self.dispatch.poll_ready(cx)
|
||||
}
|
||||
|
||||
pub(super) fn when_ready(self) -> impl Future<Output = crate::Result<Self>> {
|
||||
pub(super) async fn when_ready(self) -> crate::Result<Self> {
|
||||
let mut me = Some(self);
|
||||
future::poll_fn(move |cx| {
|
||||
ready!(me.as_mut().unwrap().poll_ready(cx))?;
|
||||
Poll::Ready(Ok(me.take().unwrap()))
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub(super) fn is_ready(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user