Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Aug 11, 2020
1 parent df8cb0b commit e81c3ef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tokio-util/src/compat.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Compatibility between the `tokio::io` and `futures-io` versions of the
//! `AsyncRead` and `AsyncWrite` traits.
use futures_core::ready;
use pin_project_lite::pin_project;
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use futures_core::ready;

pin_project! {
/// A compatibility layer that allows conversion between the
Expand Down Expand Up @@ -111,7 +111,11 @@ where
buf: &mut tokio::io::ReadBuf<'_>,
) -> Poll<io::Result<()>> {
let slice = buf.initialize_unfilled();
let n = ready!(futures_io::AsyncRead::poll_read(self.project().inner, cx, slice))?;
let n = ready!(futures_io::AsyncRead::poll_read(
self.project().inner,
cx,
slice
))?;
buf.add_filled(n);
Poll::Ready(Ok(()))
}
Expand All @@ -127,7 +131,11 @@ where
slice: &mut [u8],
) -> Poll<io::Result<usize>> {
let mut buf = tokio::io::ReadBuf::new(slice);
ready!(tokio::io::AsyncRead::poll_read(self.project().inner, cx, &mut buf))?;
ready!(tokio::io::AsyncRead::poll_read(
self.project().inner,
cx,
&mut buf
))?;
Poll::Ready(Ok(buf.filled().len()))
}
}
Expand Down

0 comments on commit e81c3ef

Please sign in to comment.