@@ -2734,7 +2734,7 @@ pub unsafe trait IntoBytes {
2734
2734
2735
2735
/// Gets the bytes of this value mutably.
2736
2736
///
2737
- /// `as_bytes_mut ` provides access to the bytes of this value as a mutable
2737
+ /// `as_mut_bytes ` provides access to the bytes of this value as a mutable
2738
2738
/// byte slice.
2739
2739
///
2740
2740
/// # Examples
@@ -2760,7 +2760,7 @@ pub unsafe trait IntoBytes {
2760
2760
/// checksum: [6, 7],
2761
2761
/// };
2762
2762
///
2763
- /// let bytes = header.as_bytes_mut ();
2763
+ /// let bytes = header.as_mut_bytes ();
2764
2764
///
2765
2765
/// assert_eq!(bytes, [0, 1, 2, 3, 4, 5, 6, 7]);
2766
2766
///
@@ -2774,7 +2774,7 @@ pub unsafe trait IntoBytes {
2774
2774
/// });
2775
2775
/// ```
2776
2776
#[ inline( always) ]
2777
- fn as_bytes_mut ( & mut self ) -> & mut [ u8 ]
2777
+ fn as_mut_bytes ( & mut self ) -> & mut [ u8 ]
2778
2778
where
2779
2779
Self : FromBytes + NoCell ,
2780
2780
{
@@ -7749,7 +7749,7 @@ mod tests {
7749
7749
///
7750
7750
/// `bytes` is the expected byte sequence returned from `t.as_bytes()`
7751
7751
/// before `t` has been modified. `post_mutation` is the expected
7752
- /// sequence returned from `t.as_bytes()` after `t.as_bytes_mut ()[0]`
7752
+ /// sequence returned from `t.as_bytes()` after `t.as_mut_bytes ()[0]`
7753
7753
/// has had its bits flipped (by applying `^= 0xFF`).
7754
7754
///
7755
7755
/// `N` is the size of `t` in bytes.
@@ -7764,9 +7764,9 @@ mod tests {
7764
7764
7765
7765
// Test that changes to the underlying byte slices are reflected in
7766
7766
// the original object.
7767
- t. as_bytes_mut ( ) [ 0 ] ^= 0xFF ;
7767
+ t. as_mut_bytes ( ) [ 0 ] ^= 0xFF ;
7768
7768
assert_eq ! ( t, post_mutation) ;
7769
- t. as_bytes_mut ( ) [ 0 ] ^= 0xFF ;
7769
+ t. as_mut_bytes ( ) [ 0 ] ^= 0xFF ;
7770
7770
7771
7771
// `write_to` rejects slices that are too small or too large.
7772
7772
assert_eq ! ( t. write_to( & mut vec![ 0 ; N - 1 ] [ ..] ) , None ) ;
@@ -8073,7 +8073,7 @@ mod tests {
8073
8073
//
8074
8074
// let r = <$ty as TryFromBytes>::try_from_ref(val.as_bytes()).unwrap();
8075
8075
// assert_eq!(r, &val);
8076
- // let r = <$ty as TryFromBytes>::try_from_mut(val.as_bytes_mut ()).unwrap();
8076
+ // let r = <$ty as TryFromBytes>::try_from_mut(val.as_mut_bytes ()).unwrap();
8077
8077
// assert_eq!(r, &mut val);
8078
8078
// let v = <$ty as TryFromBytes>::try_read_from(val.as_bytes()).unwrap();
8079
8079
// assert_eq!(v, val);
0 commit comments