Jarred Sumner
2025-01-30 07:11:03 -08:00
parent 892764ec43
commit bb7776116d
13 changed files with 25 additions and 19 deletions

View File

@@ -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
}