Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ fn infallible<T>(result: Result<T, CollectionAllocErr>) -> T {
}
}

/// Helper function to check if a type is a ZST.
#[inline]
const fn is_zst<T>() -> bool {
const { size_of::<T>() == 0 }
}

#[inline]
/// A local copy of [`core::slice::range`]. The latter function is unstable
/// and thus cannot be used yet.
Expand Down Expand Up @@ -810,7 +804,7 @@ impl<T, const N: usize> SmallVec<T, N> {
}

impl<T, const N: usize> SmallVec<T, N> {
const IS_ZST: bool = is_zst::<T>();
const IS_ZST: bool = size_of::<T>() == 0;

#[inline]
pub fn from_vec(vec: Vec<T>) -> Self {
Expand Down
Loading