File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,11 @@ pub trait Buf {
141
141
///
142
142
/// # Implementer notes
143
143
///
144
- /// This function should never panic. Once the end of the buffer is reached,
145
- /// i.e., `Buf::remaining` returns 0, calls to `chunk()` should return an
146
- /// empty slice.
144
+ /// This function should never panic. `chunk()` should return an empty
145
+ /// slice **if and only if** `remaining()` returns 0. In other words,
146
+ /// `chunk()` returning an empty slice implies that `remaining()` will
147
+ /// return 0 and `remaining()` returning 0 implies that `chunk()` will
148
+ /// return an empty slice.
147
149
// The `chunk` method was previously called `bytes`. This alias makes the rename
148
150
// more easily discoverable.
149
151
#[ cfg_attr( docsrs, doc( alias = "bytes" ) ) ]
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ pub unsafe trait BufMut {
165
165
///
166
166
/// # Implementer notes
167
167
///
168
- /// This function should never panic. `chunk_mut` should return an empty
168
+ /// This function should never panic. `chunk_mut() ` should return an empty
169
169
/// slice **if and only if** `remaining_mut()` returns 0. In other words,
170
170
/// `chunk_mut()` returning an empty slice implies that `remaining_mut()` will
171
171
/// return 0 and `remaining_mut()` returning 0 implies that `chunk_mut()` will
You can’t perform that action at this time.
0 commit comments