pub fn toOwnedSliceAssert(self: *Self) Slice
The caller owns the returned memory. Empties this ArrayList. Its capacity is cleared, making deinit() safe but unnecessary to call.
Asserts what the capacity is equal to the length. Never invalidates element pointers.
self: *Self
779 780 781 782 783 784
pub fn toOwnedSliceAssert(self: *Self) Slice { assert(self.items.len == self.capacity); const items = self.items; self.* = .empty; return items; }
The caller owns the returned memory. Empties this ArrayList. Its capacity is cleared, making deinit() safe but unnecessary to call.
Asserts what the capacity is equal to the length. Never invalidates element pointers.