aboutsummaryrefslogtreecommitdiff
path: root/benches/buf.rs
diff options
context:
space:
mode:
authorGravatar Carl Lerche <me@carllerche.com> 2020-12-18 11:04:31 -0800
committerGravatar GitHub <noreply@github.com> 2020-12-18 11:04:31 -0800
commit06907f3e7badc98b83902c27ab19661693b0979a (patch)
tree32708b56819050278270c7b6781556d59a3d5445 /benches/buf.rs
parent54f5ced6c58c47f721836a9444654de4c8d687a1 (diff)
downloadbytes-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 'benches/buf.rs')
-rw-r--r--benches/buf.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/benches/buf.rs b/benches/buf.rs
index 4b5d286..6dc8516 100644
--- a/benches/buf.rs
+++ b/benches/buf.rs
@@ -53,7 +53,7 @@ impl Buf for TestBuf {
assert!(self.pos <= self.buf.len());
self.next_readlen();
}
- fn bytes(&self) -> &[u8] {
+ fn chunk(&self) -> &[u8] {
if self.readlen == 0 {
Default::default()
} else {
@@ -87,8 +87,8 @@ impl Buf for TestBufC {
self.inner.advance(cnt)
}
#[inline(never)]
- fn bytes(&self) -> &[u8] {
- self.inner.bytes()
+ fn chunk(&self) -> &[u8] {
+ self.inner.chunk()
}
}