feat(lib): Upgrade to Tokio 1.0 (#2369)

Closes #2370
This commit is contained in:
Sean McArthur
2020-12-23 10:36:12 -08:00
committed by GitHub
parent dad5c8792f
commit fad42acc79
14 changed files with 71 additions and 146 deletions

View File

@@ -229,12 +229,12 @@ where
}
#[inline]
fn bytes(&self) -> &[u8] {
fn chunk(&self) -> &[u8] {
match self.kind {
BufKind::Exact(ref b) => b.bytes(),
BufKind::Limited(ref b) => b.bytes(),
BufKind::Chunked(ref b) => b.bytes(),
BufKind::ChunkedEnd(ref b) => b.bytes(),
BufKind::Exact(ref b) => b.chunk(),
BufKind::Limited(ref b) => b.chunk(),
BufKind::Chunked(ref b) => b.chunk(),
BufKind::ChunkedEnd(ref b) => b.chunk(),
}
}
@@ -249,12 +249,12 @@ where
}
#[inline]
fn bytes_vectored<'t>(&'t self, dst: &mut [IoSlice<'t>]) -> usize {
fn chunks_vectored<'t>(&'t self, dst: &mut [IoSlice<'t>]) -> usize {
match self.kind {
BufKind::Exact(ref b) => b.bytes_vectored(dst),
BufKind::Limited(ref b) => b.bytes_vectored(dst),
BufKind::Chunked(ref b) => b.bytes_vectored(dst),
BufKind::ChunkedEnd(ref b) => b.bytes_vectored(dst),
BufKind::Exact(ref b) => b.chunks_vectored(dst),
BufKind::Limited(ref b) => b.chunks_vectored(dst),
BufKind::Chunked(ref b) => b.chunks_vectored(dst),
BufKind::ChunkedEnd(ref b) => b.chunks_vectored(dst),
}
}
}
@@ -295,7 +295,7 @@ impl Buf for ChunkSize {
}
#[inline]
fn bytes(&self) -> &[u8] {
fn chunk(&self) -> &[u8] {
&self.bytes[self.pos.into()..self.len.into()]
}