Inline RawVec::cap
This commit is contained in:
parent
af0a433865
commit
06f5fa4a0c
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue