From b84ed4f563b3536365f7d3cc4d068407e98685b3 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Sat, 20 Jun 2026 22:53:50 +0200 Subject: It's a revolution baby. --- src/zisp/value/array.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/zisp/value/array.zig') diff --git a/src/zisp/value/array.zig b/src/zisp/value/array.zig index ad04ce2..5d326a1 100644 --- a/src/zisp/value/array.zig +++ b/src/zisp/value/array.zig @@ -140,7 +140,7 @@ pub const ArrayHeader = packed struct(u64) { } } - pub fn str(self: *Self) []const u8 { + pub fn bytes(self: *Self) []u8 { if (self.is_slice) { const buf = self.bufU8(); const start, const end = self.sliceInfo(); @@ -149,11 +149,15 @@ pub const ArrayHeader = packed struct(u64) { var arr = self; if (self.is_ptr) { arr = self.arrPointer() orelse { - @panic("Called str() on array with direct buffer pointer."); + @panic("Called bytes() on array with direct buffer pointer."); }; } return arr.bufContent()[0..arr.size()]; } + + pub fn bytesRO(self: *Self) []const u8 { + return self.bytes(); + } }; const ArrayType = enum(u2) { int, flt, val, str }; -- cgit v1.2.3