Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@ impl<T> ThinVec<T> {
self.header().cap()
}

/// Returns `true` if the vector has the capacity to hold any element.
pub fn has_capacity(&self) -> bool {
!self.is_singleton()
}

/// Forces the length of the vector to `new_len`.
///
/// This is a low-level operation that maintains none of the normal
Expand Down