We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b9e3de0 + d9c0cd6 commit 1b79c91Copy full SHA for 1b79c91
1 file changed
src/lib.rs
@@ -666,6 +666,11 @@ impl<T> ThinVec<T> {
666
self.header().cap()
667
}
668
669
+ /// Returns `true` if the vector has the capacity to hold any element.
670
+ pub fn has_capacity(&self) -> bool {
671
+ !self.is_singleton()
672
+ }
673
+
674
/// Forces the length of the vector to `new_len`.
675
///
676
/// This is a low-level operation that maintains none of the normal
0 commit comments