fix: BufferWriter never returns an error (#18981)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Don Isaac
2025-04-13 08:57:41 -07:00
committed by GitHub
parent f937750ff0
commit f730a355bf
17 changed files with 29 additions and 36 deletions

View File

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