Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bytes_mut -> chunk_mut rename more easily discoverable #471

Merged
merged 4 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# 1.0.0 (December 22, 2020)

### Changed
- Rename Buf/BufMut, methods to chunk/chunk_mut (#450)
- Rename `Buf`/`BufMut` methods `bytes()` and `bytes_mut()` to `chunk()` and `chunk_mut()` (#450)

### Removed
- remove unused Buf implementation. (#449)
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ serde_test = "1.0"

[target.'cfg(loom)'.dev-dependencies]
loom = "0.4"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
1 change: 1 addition & 0 deletions src/buf/buf_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ 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.
#[cfg_attr(docsrs, doc(alias = "bytes"))]
taiki-e marked this conversation as resolved.
Show resolved Hide resolved
fn chunk(&self) -> &[u8];

/// Fills `dst` with potentially multiple slices starting at `self`'s
Expand Down
1 change: 1 addition & 0 deletions src/buf/buf_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ 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.
#[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
Expand Down