Skip to content

Commit

Permalink
Use size_of from core instead of one from std
Browse files Browse the repository at this point in the history
  • Loading branch information
agerasev committed Sep 26, 2024
1 parent d5731fc commit 33f9798
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 std::mem::size_of::<T>() != 0 {
if core::mem::size_of::<T>() != 0 {
unsafe { value.set_len(value.capacity()) };
}
Self::from(value.into_boxed_slice())
Expand Down

0 comments on commit 33f9798

Please sign in to comment.