remove pin<self> bounds from consume

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
Yoshua Wuyts 2019-09-10 13:18:07 +02:00
parent 8fe7347771
commit ab0a4cb966
No known key found for this signature in database
GPG key ID: 24EA8164F96777ED

View file

@ -63,6 +63,15 @@ pub trait BufRead {
FillBufFuture::new(self)
}
/// Tells this buffer that `amt` bytes have been consumed from the buffer, so they should no
/// longer be returned in calls to `read`.
fn consume(&mut self, amt: usize)
where
Self: AsyncBufRead + Unpin,
{
AsyncBufRead::consume(Pin::new(self), amt)
}
/// Reads all bytes into `buf` until the delimiter `byte` or EOF is reached.
///
/// This function will read bytes from the underlying stream until the delimiter or EOF is