Skip to content

Commit

Permalink
Format and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Oct 28, 2019
1 parent beeb02e commit 1336487
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
12 changes: 2 additions & 10 deletions tokio/src/io/io/buf_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ impl<R: AsyncRead> AsyncBufRead for BufReader<R> {
fn poll_read_into_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<usize>> {
#[project]
let BufReader {
inner,
buf,
cap,
pos: _,
inner, buf, cap, ..
} = self.project();

if *cap < buf.len() {
Expand All @@ -148,12 +145,7 @@ impl<R: AsyncRead> AsyncBufRead for BufReader<R> {
#[project]
fn get_buf(self: Pin<&mut Self>) -> &[u8] {
#[project]
let BufReader {
inner: _,
buf,
cap,
pos,
} = self.project();
let BufReader { buf, cap, pos, .. } = self.project();
&buf[*pos..*cap]
}

Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/io/fill_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl<'a, R: AsyncBufRead + ?Sized + Unpin> Future for FillBuf<'a, R> {
match reader.as_mut().poll_read_into_buf(cx) {
Poll::Pending => {
self.reader = Some(reader.get_mut());
return Poll::Pending
return Poll::Pending;
}
Poll::Ready(result) => {
result?;
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/io/io/read_into_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ pub(crate) fn read_into_buf<'a, R>(reader: &'a mut R) -> ReadIntoBuf<'a, R>
where
R: AsyncBufRead + ?Sized + Unpin,
{
ReadIntoBuf {
reader,
}
ReadIntoBuf { reader }
}

impl<R: AsyncBufRead + ?Sized + Unpin> Future for ReadIntoBuf<'_, R> {
Expand Down

0 comments on commit 1336487

Please sign in to comment.