Skip to content

Commit

Permalink
Simplify UninitSlice::as_uninit_slice_mut() logic (#644)
Browse files Browse the repository at this point in the history
This reworks `UninitSlice::as_uninit_slice_mut()` using equivalent
simpler logic.
  • Loading branch information
lucab committed Dec 28, 2023
1 parent 72cbb92 commit f73c6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/buf/uninit_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl UninitSlice {
/// ```
#[inline]
pub unsafe fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<u8>] {
&mut *(self as *mut _ as *mut [MaybeUninit<u8>])
&mut self.0
}

/// Returns the number of bytes in the slice.
Expand Down

0 comments on commit f73c6c8

Please sign in to comment.