diff options
author | 2021-01-23 07:22:43 +0100 | |
---|---|---|
committer | 2021-01-23 15:22:43 +0900 | |
commit | e4182808df772e331fbd25c48f2f1ab79c0d7c20 (patch) | |
tree | cb21ac617cbb35af592eb14d04df4bdda0756594 /src | |
parent | 8daf43e9bde134e32fc0b8938abc92695f6850d1 (diff) | |
download | bytes-e4182808df772e331fbd25c48f2f1ab79c0d7c20.tar.gz bytes-e4182808df772e331fbd25c48f2f1ab79c0d7c20.tar.zst bytes-e4182808df772e331fbd25c48f2f1ab79c0d7c20.zip |
Make bytes_mut -> chunk_mut rename more easily discoverable (#471)
Diffstat (limited to 'src')
-rw-r--r-- | src/buf/buf_impl.rs | 3 | ||||
-rw-r--r-- | src/buf/buf_mut.rs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/buf/buf_impl.rs b/src/buf/buf_impl.rs index 16ad8a7..a33c8a4 100644 --- a/src/buf/buf_impl.rs +++ b/src/buf/buf_impl.rs @@ -127,6 +127,9 @@ pub trait Buf { /// This function should never panic. Once the end of the buffer is reached, /// i.e., `Buf::remaining` returns 0, calls to `chunk()` should return an /// empty slice. + // The `chunk` method was previously called `bytes`. This alias makes the rename + // more easily discoverable. + #[cfg_attr(docsrs, doc(alias = "bytes"))] fn chunk(&self) -> &[u8]; /// Fills `dst` with potentially multiple slices starting at `self`'s diff --git a/src/buf/buf_mut.rs b/src/buf/buf_mut.rs index f736727..eccd509 100644 --- a/src/buf/buf_mut.rs +++ b/src/buf/buf_mut.rs @@ -158,6 +158,9 @@ pub unsafe trait BufMut { /// `chunk_mut()` returning an empty slice implies that `remaining_mut()` will /// return 0 and `remaining_mut()` returning 0 implies that `chunk_mut()` will /// return an empty slice. + // The `chunk_mut` method was previously called `bytes_mut`. This alias makes the + // rename more easily discoverable. + #[cfg_attr(docsrs, doc(alias = "bytes_mut"))] fn chunk_mut(&mut self) -> &mut UninitSlice; /// Transfer bytes into `self` from `src` and advance the cursor by the |