diff --git a/src/http/stream_body.rs b/src/http/stream_body.rs index 0c654764..cb35471b 100644 --- a/src/http/stream_body.rs +++ b/src/http/stream_body.rs @@ -7,7 +7,7 @@ use std::pin::Pin; /// An Adapter for bytes stream to `AsyncRead` pub struct StreamBody { s: S, - remain_bytes: Option, + remaining_bytes: Option, } impl StreamBody { @@ -15,7 +15,7 @@ impl StreamBody { pub fn new(s: S) -> Self { Self { s, - remain_bytes: None, + remaining_bytes: None, } } } @@ -31,17 +31,17 @@ where buf: &mut [u8], ) -> Poll> { loop { - if let Some(bytes) = &mut self.remain_bytes { + if let Some(bytes) = &mut self.remaining_bytes { let data = bytes.split_to(buf.len().min(bytes.len())); buf[..data.len()].copy_from_slice(&data); if !bytes.has_remaining() { - self.remain_bytes = None; + self.remaining_bytes = None; } return Poll::Ready(Ok(data.len())); } else { match self.s.poll_next_unpin(cx) { Poll::Ready(Some(Ok(mut bytes))) => { - self.remain_bytes = Some(bytes.to_bytes()); + self.remaining_bytes = Some(bytes.to_bytes()); } Poll::Ready(Some(Err(_))) => { return Poll::Ready(Err(Error::from(ErrorKind::InvalidData)))