Skip to content

Commit c5fae00

Browse files
authored
copy_to_bytes: Add panic section to docs (#676)
Fixes #454.
1 parent 99584cc commit c5fae00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/buf/buf_impl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,10 @@ pub trait Buf {
11201120
/// let bytes = (&b"hello world"[..]).copy_to_bytes(5);
11211121
/// assert_eq!(&bytes[..], &b"hello"[..]);
11221122
/// ```
1123+
///
1124+
/// # Panics
1125+
///
1126+
/// This function panics if `len > self.remaining()`.
11231127
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
11241128
use super::BufMut;
11251129

0 commit comments

Comments
 (0)