diff options
Diffstat (limited to 'src/zisp/value.zig')
| -rw-r--r-- | src/zisp/value.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig index 449a577..2d148ed 100644 --- a/src/zisp/value.zig +++ b/src/zisp/value.zig @@ -170,7 +170,14 @@ const endian = builtin.target.cpu.arch.endian(); const max = std.math.maxInt; /// Used when dealing with runes and short strings. -pub const ShortString = std.BoundedArray(u8, 6); +pub const ShortString = struct { + len: u8, + buf: [6]u8, + + pub fn slice(this: @This()) []const u8 { + return this.buf[0..this.len]; + } +}; /// Used to find the length of a rune or short string. pub fn sstrLen(x: u64) u8 { |
