diff --git a/kube-client/src/client/body.rs b/kube-client/src/client/body.rs index 960a9801e..b2888d0de 100644 --- a/kube-client/src/client/body.rs +++ b/kube-client/src/client/body.rs @@ -1,8 +1,8 @@ use std::{ error::Error as StdError, fmt, - pin::Pin, - task::{ready, Context, Poll}, + pin::{pin, Pin}, + task::{Context, Poll}, }; use bytes::Bytes; @@ -87,10 +87,7 @@ impl HttpBody for Body { ) -> Poll, Self::Error>>> { match &mut self.kind { Kind::Once(val) => Poll::Ready(val.take().map(|bytes| Ok(Frame::data(bytes)))), - Kind::Wrap(body) => Poll::Ready( - ready!(Pin::new(body).poll_frame(cx)) - .map(|opt_chunk| opt_chunk.map_err(crate::Error::Service)), - ), + Kind::Wrap(body) => pin!(body).poll_frame(cx).map_err(crate::Error::Service), } }