Skip to content

Commit

Permalink
Prune unnecessary pin! macro calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sagebind committed Dec 12, 2020
1 parent 1fdcae7 commit 876cc03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use crate::{
use futures_lite::{
future::{block_on, try_zip},
io::AsyncRead,
pin,
};
use http::{
header::{HeaderMap, HeaderName, HeaderValue},
Expand Down Expand Up @@ -1269,8 +1268,7 @@ impl AsyncRead for ResponseBody {
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
let inner = &mut self.inner;
pin!(inner);
let inner = Pin::new(&mut self.inner);
inner.poll_read(cx, buf)
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crossbeam_utils::atomic::AtomicCell;
use curl::easy::{InfoType, ReadError, SeekResult, WriteError};
use curl_sys::CURL;
use flume::Sender;
use futures_lite::{io::{AsyncRead, AsyncWrite}, pin};
use futures_lite::io::{AsyncRead, AsyncWrite};
use http::Response;
use once_cell::sync::OnceCell;
use sluice::pipe;
Expand Down Expand Up @@ -646,8 +646,7 @@ impl AsyncRead for ResponseBodyReader {
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
let inner = &mut self.inner;
pin!(inner);
let inner = Pin::new(&mut self.inner);

match inner.poll_read(cx, buf) {
// On EOF, check to see if the transfer was cancelled, and if so,
Expand Down

0 comments on commit 876cc03

Please sign in to comment.