fn toOwnedSlice(self: *Self, allocator: Allocator) Allocator.Error!Slice

The caller owns the returned memory. Empties this ArrayList. Its capacity is cleared, making deinit() safe but unnecessary to call.

Parameters

self: *Self,
allocator: Allocator,