diff options
author | 2020-12-18 11:04:31 -0800 | |
---|---|---|
committer | 2020-12-18 11:04:31 -0800 | |
commit | 06907f3e7badc98b83902c27ab19661693b0979a (patch) | |
tree | 32708b56819050278270c7b6781556d59a3d5445 /src/buf/take.rs | |
parent | 54f5ced6c58c47f721836a9444654de4c8d687a1 (diff) | |
download | bytes-06907f3e7badc98b83902c27ab19661693b0979a.tar.gz bytes-06907f3e7badc98b83902c27ab19661693b0979a.tar.zst bytes-06907f3e7badc98b83902c27ab19661693b0979a.zip |
Rename Buf/BufMut, methods to chunk/chunk_mut (#450)
The `bytes()` / `bytes_mut()` name implies the method returns the full
set of bytes represented by `Buf`/`BufMut`. To rectify this, the methods
are renamed to `chunk()` and `chunk_mut()` to reflect the partial nature
of the returned byte slice.
`bytes_vectored()` is renamed `chunks_vectored()`.
Closes #447
Diffstat (limited to 'src/buf/take.rs')
-rw-r--r-- | src/buf/take.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buf/take.rs b/src/buf/take.rs index 57b9f45..1747f6e 100644 --- a/src/buf/take.rs +++ b/src/buf/take.rs @@ -134,8 +134,8 @@ impl<T: Buf> Buf for Take<T> { cmp::min(self.inner.remaining(), self.limit) } - fn bytes(&self) -> &[u8] { - let bytes = self.inner.bytes(); + fn chunk(&self) -> &[u8] { + let bytes = self.inner.chunk(); &bytes[..cmp::min(bytes.len(), self.limit)] } |