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