Skip to content

Commit

Permalink
copy_to_bytes: Add panic section to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Mar 3, 2024
1 parent 99584cc commit ce84099
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/buf/buf_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,10 @@ pub trait Buf {
/// let bytes = (&b"hello world"[..]).copy_to_bytes(5);
/// assert_eq!(&bytes[..], &b"hello"[..]);
/// ```
///
/// # Panics
///
/// This function panics if `len > self.remaining()`.
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
use super::BufMut;

Expand Down

0 comments on commit ce84099

Please sign in to comment.