diff --git a/allocating_writer.zig b/allocating_writer.zig index 4f32ace5dc60b20ced239d3c34167437ba0f127d..e5dd9964f9144c36dca79ae97f11cdb529e1f6bd 100644 --- a/allocating_writer.zig +++ b/allocating_writer.zig @@ -51,11 +51,11 @@ pub const AllocatingWriter = struct { self.capacity = new_capacity; } - fn unusedSlice(self: *AllocatingWriter) []u8 { + pub fn unusedSlice(self: *AllocatingWriter) []u8 { return self.allocatedSlice()[self.items.len..]; } - fn appendAssumeCapacity(self: *AllocatingWriter, bytes: []const u8) void { + pub fn appendAssumeCapacity(self: *AllocatingWriter, bytes: []const u8) void { @memcpy(self.unusedSlice()[0..bytes.len], bytes); self.items.len += bytes.len; }