diff options
Diffstat (limited to 'tokio-io/src/async_buf_read.rs')
-rw-r--r-- | tokio-io/src/async_buf_read.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/tokio-io/src/async_buf_read.rs b/tokio-io/src/async_buf_read.rs index d0c4952d..dfac44f3 100644 --- a/tokio-io/src/async_buf_read.rs +++ b/tokio-io/src/async_buf_read.rs @@ -31,10 +31,7 @@ pub trait AsyncBufRead: AsyncRead { /// /// [`poll_read`]: AsyncRead::poll_read /// [`consume`]: AsyncBufRead::consume - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, - cx: &mut Context<'_>, - ) -> Poll<io::Result<&'a [u8]>>; + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>>; /// Tells this buffer that `amt` bytes have been consumed from the buffer, /// so they should no longer be returned in calls to [`poll_read`]. @@ -56,8 +53,8 @@ pub trait AsyncBufRead: AsyncRead { macro_rules! deref_async_buf_read { () => { - fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>) - -> Poll<io::Result<&'a [u8]>> + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) + -> Poll<io::Result<&[u8]>> { Pin::new(&mut **self.get_mut()).poll_fill_buf(cx) } @@ -81,10 +78,7 @@ where P: DerefMut + Unpin, P::Target: AsyncBufRead, { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, - cx: &mut Context<'_>, - ) -> Poll<io::Result<&'a [u8]>> { + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> { self.get_mut().as_mut().poll_fill_buf(cx) } @@ -94,10 +88,7 @@ where } impl AsyncBufRead for &[u8] { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, - _cx: &mut Context<'_>, - ) -> Poll<io::Result<&'a [u8]>> { + fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> { Poll::Ready(Ok(*self)) } @@ -107,10 +98,7 @@ impl AsyncBufRead for &[u8] { } impl<T: AsRef<[u8]> + Unpin> AsyncBufRead for io::Cursor<T> { - fn poll_fill_buf<'a>( - self: Pin<&'a mut Self>, - _cx: &mut Context<'_>, - ) -> Poll<io::Result<&'a [u8]>> { + fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> { Poll::Ready(io::BufRead::fill_buf(self.get_mut())) } |