mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
refactor OOM errors (#11540)
This commit is contained in:
@@ -228,7 +228,7 @@ pub const MutableString = struct {
|
||||
}
|
||||
|
||||
pub fn toOwnedSlice(self: *MutableString) string {
|
||||
return self.list.toOwnedSlice(self.allocator) catch @panic("Allocation Error"); // TODO
|
||||
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
|
||||
}
|
||||
|
||||
pub fn toOwnedSliceLeaky(self: *MutableString) []u8 {
|
||||
@@ -255,7 +255,7 @@ pub const MutableString = struct {
|
||||
|
||||
pub fn toOwnedSliceLength(self: *MutableString, length: usize) string {
|
||||
self.list.shrinkAndFree(self.allocator, length);
|
||||
return self.list.toOwnedSlice(self.allocator) catch @panic("Allocation Error"); // TODO
|
||||
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
|
||||
}
|
||||
|
||||
// pub fn deleteAt(self: *MutableString, i: usize) {
|
||||
|
||||
Reference in New Issue
Block a user