From 06907f3e7badc98b83902c27ab19661693b0979a Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 18 Dec 2020 11:04:31 -0800 Subject: 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 --- tests/test_bytes.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test_bytes.rs') diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index b97cce6..78be4b7 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -912,20 +912,20 @@ fn bytes_buf_mut_advance() { let mut bytes = BytesMut::with_capacity(1024); unsafe { - let ptr = bytes.bytes_mut().as_mut_ptr(); - assert_eq!(1024, bytes.bytes_mut().len()); + let ptr = bytes.chunk_mut().as_mut_ptr(); + assert_eq!(1024, bytes.chunk_mut().len()); bytes.advance_mut(10); - let next = bytes.bytes_mut().as_mut_ptr(); - assert_eq!(1024 - 10, bytes.bytes_mut().len()); + let next = bytes.chunk_mut().as_mut_ptr(); + assert_eq!(1024 - 10, bytes.chunk_mut().len()); assert_eq!(ptr.offset(10), next); // advance to the end bytes.advance_mut(1024 - 10); // The buffer size is doubled - assert_eq!(1024, bytes.bytes_mut().len()); + assert_eq!(1024, bytes.chunk_mut().len()); } } -- cgit v1.2.3