mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
fix: BufferWriter never returns an error (#18981)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -2135,7 +2135,7 @@ pub const PackCommand = struct {
|
||||
}
|
||||
|
||||
const has_trailing_newline = json.source.contents.len > 0 and json.source.contents[json.source.contents.len - 1] == '\n';
|
||||
var buffer_writer = try js_printer.BufferWriter.init(allocator);
|
||||
var buffer_writer = js_printer.BufferWriter.init(allocator);
|
||||
try buffer_writer.buffer.list.ensureTotalCapacity(allocator, json.source.contents.len + 1);
|
||||
buffer_writer.append_newline = has_trailing_newline;
|
||||
var package_json_writer = js_printer.BufferPrinter.init(buffer_writer);
|
||||
|
||||
Reference in New Issue
Block a user