DoxigAlpha

shrinkRetainingCapacity

Reduce length to new_len. Invalidates pointers for the elements at index new_len and beyond.

Function parameters

Parameters

#
self:*Self
new_len:usize

This is a stack data structure where pointers to indexes have the same lifetime as the data structure

Functions

#
SegmentedList
This is a stack data structure where pointers to indexes have the same lifetime as the data structure

Source

Implementation

#
pub fn shrinkRetainingCapacity(self: *Self, new_len: usize) void {
    assert(new_len <= self.len);
    self.len = new_len;
}