Skip to content

Commit

Permalink
Use std mem size_of
Browse files Browse the repository at this point in the history
  • Loading branch information
cholcombe973 committed Sep 25, 2024
1 parent 9cf82af commit d5731fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<T> From<Vec<MaybeUninit<T>>> for Heap<T> {
// Convert `value` to boxed slice of length equals to `value.capacity()`
// except for zero-sized types - for them length will be `value.len()` because `Vec::capacity` for ZST is undefined
// (see <https://doc.rust-lang.org/std/vec/struct.Vec.html#guarantees>).
if size_of::<T>() != 0 {
if std::mem::size_of::<T>() != 0 {
unsafe { value.set_len(value.capacity()) };
}
Self::from(value.into_boxed_slice())
Expand Down

0 comments on commit d5731fc

Please sign in to comment.