Skip to content

Commit 6ed2b7c

Browse files
committed
Rename string buffer functions
* addString -> addStringZ * addBytes -> addString
1 parent a17b582 commit 6ed2b7c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3492,7 +3492,7 @@ pub const Buffer = struct {
34923492

34933493
/// Adds the string to the buffer
34943494
/// See https://www.lua.org/manual/5.4/manual.html#luaL_addlstring
3495-
pub fn addBytes(buf: *Buffer, str: []const u8) void {
3495+
pub fn addString(buf: *Buffer, str: []const u8) void {
34963496
c.luaL_addlstring(&buf.b, str.ptr, str.len);
34973497
}
34983498

@@ -3511,7 +3511,7 @@ pub const Buffer = struct {
35113511

35123512
/// Adds the zero-terminated string pointed to by `str` to the buffer
35133513
/// See https://www.lua.org/manual/5.4/manual.html#luaL_addstring
3514-
pub fn addString(buf: *Buffer, str: [:0]const u8) void {
3514+
pub fn addStringZ(buf: *Buffer, str: [:0]const u8) void {
35153515
switch (lang) {
35163516
.luau => c.luaL_addlstring(&buf.b, str.ptr, str.len),
35173517
else => c.luaL_addstring(&buf.b, str.ptr),

src/tests.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,14 @@ test "string buffers" {
553553
buffer.init(lua);
554554

555555
buffer.addChar('z');
556-
buffer.addString("igl");
556+
buffer.addStringZ("igl");
557557

558558
var str = buffer.prep();
559559
str[0] = 'u';
560560
str[1] = 'a';
561561
buffer.addSize(2);
562562

563-
buffer.addBytes(" api ");
563+
buffer.addString(" api ");
564564
lua.pushNumber(5.1);
565565
buffer.addValue();
566566
buffer.pushResult();

0 commit comments

Comments
 (0)