diff options
author | 2017-03-19 13:58:09 -0700 | |
---|---|---|
committer | 2017-03-19 13:58:44 -0700 | |
commit | bed128b2c0697a34e96b4b4d77c00cd8f1d13ca3 (patch) | |
tree | 5c092ebe094e00c9028ca8120bdb93d7f97dab74 | |
parent | 5a265cc8ebef1614581661aa77b9290de3a493e1 (diff) | |
download | bytes-bed128b2c0697a34e96b4b4d77c00cd8f1d13ca3.tar.gz bytes-bed128b2c0697a34e96b4b4d77c00cd8f1d13ca3.tar.zst bytes-bed128b2c0697a34e96b4b4d77c00cd8f1d13ca3.zip |
Clarify when `BufMut::bytes_mut` can return &[]
Closes #79
-rw-r--r-- | src/buf/buf_mut.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buf/buf_mut.rs b/src/buf/buf_mut.rs index 91eacbf..de576a5 100644 --- a/src/buf/buf_mut.rs +++ b/src/buf/buf_mut.rs @@ -153,8 +153,10 @@ pub trait BufMut { /// /// # Implementer notes /// - /// This function should never panic. Once the end of the buffer is reached, - /// i.e., `BufMut::remaining_mut` returns 0, calls to `bytes_mut` should + /// This function should never panic. `bytes_mut` should return an empty + /// slice **if and only if** `remaining_mut` returns 0. In other words, + /// `bytes_mut` returning an empty slice implies that `remaining_mut` will + /// return 0 and `remaining_mut` returning 0 implies that `bytes_mut` will /// return an empty slice. unsafe fn bytes_mut(&mut self) -> &mut [u8]; |