mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
fix: BufferWriter never returns an error (#18981)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -71,10 +71,13 @@ pub fn bufferedWriter(self: *MutableString) BufferedWriter {
|
||||
}
|
||||
|
||||
pub fn init(allocator: Allocator, capacity: usize) Allocator.Error!MutableString {
|
||||
return MutableString{ .allocator = allocator, .list = if (capacity > 0)
|
||||
try std.ArrayListUnmanaged(u8).initCapacity(allocator, capacity)
|
||||
else
|
||||
std.ArrayListUnmanaged(u8){} };
|
||||
return MutableString{
|
||||
.allocator = allocator,
|
||||
.list = if (capacity > 0)
|
||||
try std.ArrayListUnmanaged(u8).initCapacity(allocator, capacity)
|
||||
else
|
||||
std.ArrayListUnmanaged(u8){},
|
||||
};
|
||||
}
|
||||
|
||||
pub fn initEmpty(allocator: Allocator) MutableString {
|
||||
|
||||
Reference in New Issue
Block a user