Skip to content

Commit

Permalink
Minor changes (to be squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhenrymantilla authored Feb 7, 2020
1 parent e3926f9 commit 42dc756
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extension_traits/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ where
slice::from_raw_parts_mut(
self.as_mut_ptr().cast::<MaybeUninit<T>>(),
capacity,
).as_out::<[Self::Item]>()
).as_out::<[T]>()
}
}

Expand All @@ -53,6 +53,7 @@ where
/// it is not officially guaranteed that the allocation of a `Vec`
/// (a `RawVec`) matches the allocation of a boxed slice, even if in their
/// current implementations they do.
#[inline]
fn into_backing_buffer (self: Vec<T>)
-> Vec<MaybeUninit<T>> // ideally this would be a `Box<[]>`, but `Vec` does not guarantee it.
{
Expand Down Expand Up @@ -83,6 +84,7 @@ where
/// `&mut [MaybeUninit<T>]`.
///
/// [backing buffer]: `VecAllocation::get_backing_buffer`
#[inline]
fn split_at_extra_capacity (self: &'_ mut Vec<T>)
-> (&'_ mut [T], &'_ mut [MaybeUninit<T>])
{
Expand Down Expand Up @@ -158,6 +160,7 @@ where
/// b"Hello, World!",
/// );
/// ```
#[inline]
fn reserve_uninit (self: &'_ mut Vec<T>, additional: usize)
-> &'_ mut [MaybeUninit<T>]
{
Expand Down

0 comments on commit 42dc756

Please sign in to comment.