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
This commit is contained in:
Carl Lerche
2020-12-18 11:04:31 -08:00
committed by GitHub
parent 54f5ced6c5
commit 06907f3e7b
18 changed files with 96 additions and 95 deletions
+1 -1
View File
@@ -530,7 +530,7 @@ impl Buf for Bytes {
}
#[inline]
fn bytes(&self) -> &[u8] {
fn chunk(&self) -> &[u8] {
self.as_slice()
}