pub fn shrinkToLen(self: *Self, gpa: Allocator) Allocator.Error!void
Shrinks capacity to match length. May invalidate element pointers. If succeds it is safe to call toOwnedSliceAssert.
toOwnedSliceAssert
self: *Self
gpa: Allocator
1290 1291 1292
pub fn shrinkToLen(self: *Self, gpa: Allocator) Allocator.Error!void { try self.shrinkAndFreePrecise(gpa, self.items.len); }
Shrinks capacity to match length. May invalidate element pointers. If succeds it is safe to call
toOwnedSliceAssert.