Inline RawVec::cap

This commit is contained in:
Matt Brubeck 2016-05-09 11:43:33 -07:00
parent af0a433865
commit 06f5fa4a0c

View file

@ -147,6 +147,7 @@ impl<T> RawVec<T> {
/// Gets the capacity of the allocation.
///
/// This will always be `usize::MAX` if `T` is zero-sized.
#[inline(always)]
pub fn cap(&self) -> usize {
if mem::size_of::<T>() == 0 {
!0