refactor: lots more writergate fixes - first successful build

This commit is contained in:
CJ van den Berg 2025-09-25 22:01:29 +02:00
parent 5094aa8c85
commit bf0d4402ea
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
48 changed files with 404 additions and 413 deletions

View file

@ -57,7 +57,7 @@ fn remove_prefix_in_line(prefix: []const u8, text: []const u8, writer: TextWrite
pub fn toggle_prefix_in_text(prefix: []const u8, text: []const u8, allocator: std.mem.Allocator) ![]const u8 {
var result = try std.ArrayList(u8).initCapacity(allocator, prefix.len + text.len);
const writer = result.writer();
const writer = result.writer(allocator);
var pos: usize = 0;
var prefix_pos: usize = std.math.maxInt(usize);
var have_prefix = true;
@ -87,5 +87,5 @@ pub fn toggle_prefix_in_text(prefix: []const u8, text: []const u8, allocator: st
_ = try writer.write("\n");
pos = next + 1;
}
return result.toOwnedSlice();
return result.toOwnedSlice(allocator);
}