mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
This commit is contained in:
@@ -264,7 +264,7 @@ pub const MutableString = struct {
|
||||
}
|
||||
|
||||
pub fn toOwnedSliceLength(self: *MutableString, length: usize) string {
|
||||
self.list.shrinkAndFree(self.allocator, length);
|
||||
self.list.items.len = @min(length, self.list.items.len);
|
||||
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user