From d5731fcf90d8f5455a81530c5d73df64b92d167f Mon Sep 17 00:00:00 2001 From: Chris Holcombe Date: Wed, 25 Sep 2024 11:01:24 -0700 Subject: [PATCH 1/2] Use std mem size_of --- src/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.rs b/src/storage.rs index 6559446..ffff95f 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -168,7 +168,7 @@ impl From>> for Heap { // 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 ). - if size_of::() != 0 { + if std::mem::size_of::() != 0 { unsafe { value.set_len(value.capacity()) }; } Self::from(value.into_boxed_slice()) From 33f97982099b66203acb00332438189918f28c13 Mon Sep 17 00:00:00 2001 From: Alexey Gerasev Date: Thu, 26 Sep 2024 10:42:36 +0700 Subject: [PATCH 2/2] Use `size_of` from `core` instead of one from `std` --- src/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.rs b/src/storage.rs index ffff95f..973d1c2 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -168,7 +168,7 @@ impl From>> for Heap { // 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 ). - if std::mem::size_of::() != 0 { + if core::mem::size_of::() != 0 { unsafe { value.set_len(value.capacity()) }; } Self::from(value.into_boxed_slice())