Skip to content

Commit

Permalink
Fix compilation when feature bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Feb 3, 2022
1 parent ace7448 commit c0890c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protobuf/src/buf_read_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ impl<'ignore> BufReadIter<'ignore> {
}

#[cfg(feature = "bytes")]
unsafe fn uninit_slice_as_mut_slice(slice: &mut UninitSlice) -> &mut [u8] {
unsafe fn uninit_slice_as_mut_slice(slice: &mut UninitSlice) -> &mut [MaybeUninit<u8>] {
use std::slice;
slice::from_raw_parts_mut(slice.as_mut_ptr(), slice.len())
slice::from_raw_parts_mut(slice.as_mut_ptr() as *mut MaybeUninit<u8>, slice.len())
}

/// Returns 0 when EOF or limit reached.
Expand Down

0 comments on commit c0890c2

Please sign in to comment.