@@ -703,7 +703,7 @@ pub unsafe trait BufMut {
703
703
self . put_slice ( & n. to_le_bytes ( ) [ 0 ..nbytes] ) ;
704
704
}
705
705
706
- /// Writes a signed n-byte integer to `self` in big-endian byte order.
706
+ /// Writes low `nbytes` of a signed integer to `self` in big-endian byte order.
707
707
///
708
708
/// The current position is advanced by `nbytes`.
709
709
///
@@ -713,19 +713,19 @@ pub unsafe trait BufMut {
713
713
/// use bytes::BufMut;
714
714
///
715
715
/// let mut buf = vec![];
716
- /// buf.put_int(0x010203 , 3);
716
+ /// buf.put_int(0x0504010203 , 3);
717
717
/// assert_eq!(buf, b"\x01\x02\x03");
718
718
/// ```
719
719
///
720
720
/// # Panics
721
721
///
722
722
/// This function panics if there is not enough remaining capacity in
723
- /// `self`.
723
+ /// `self` or if `nbytes` is greater than 8 .
724
724
fn put_int ( & mut self , n : i64 , nbytes : usize ) {
725
725
self . put_slice ( & n. to_be_bytes ( ) [ mem:: size_of_val ( & n) - nbytes..] ) ;
726
726
}
727
727
728
- /// Writes a signed n-byte integer to `self` in little-endian byte order.
728
+ /// Writes low `nbytes` of a signed integer to `self` in little-endian byte order.
729
729
///
730
730
/// The current position is advanced by `nbytes`.
731
731
///
@@ -735,14 +735,14 @@ pub unsafe trait BufMut {
735
735
/// use bytes::BufMut;
736
736
///
737
737
/// let mut buf = vec![];
738
- /// buf.put_int_le(0x010203 , 3);
738
+ /// buf.put_int_le(0x0504010203 , 3);
739
739
/// assert_eq!(buf, b"\x03\x02\x01");
740
740
/// ```
741
741
///
742
742
/// # Panics
743
743
///
744
744
/// This function panics if there is not enough remaining capacity in
745
- /// `self`.
745
+ /// `self` or if `nbytes` is greater than 8 .
746
746
fn put_int_le ( & mut self , n : i64 , nbytes : usize ) {
747
747
self . put_slice ( & n. to_le_bytes ( ) [ 0 ..nbytes] ) ;
748
748
}
0 commit comments