From 4660865c0c08139d59671b1719a7515da4222d03 Mon Sep 17 00:00:00 2001 From: Alejandro Vaz Date: Mon, 31 Aug 2026 19:11:31 +0200 Subject: [PATCH] refactor: removed is_zst helper --- src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e14c3b3..4ba6195 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,12 +158,6 @@ fn infallible(result: Result) -> T { } } -/// Helper function to check if a type is a ZST. -#[inline] -const fn is_zst() -> bool { - const { size_of::() == 0 } -} - #[inline] /// A local copy of [`core::slice::range`]. The latter function is unstable /// and thus cannot be used yet. @@ -810,7 +804,7 @@ impl SmallVec { } impl SmallVec { - const IS_ZST: bool = is_zst::(); + const IS_ZST: bool = size_of::() == 0; #[inline] pub fn from_vec(vec: Vec) -> Self {