const std = @import("std"); const state = struct { var buf: [256]u8 = undefined; }; var fba = std.heap.FixedBufferAllocator.init(state.buf[0..]); pub fn tmpZ(str: []const u8) ![:0]const u8 { fba.reset(); return try std.fmt.allocPrintZ(fba.allocator(), "{s}", .{str}); } pub fn tmpFmtZ(comptime fmt: []const u8, args: anytype) ![:0]const u8 { fba.reset(); return try std.fmt.allocPrintZ(fba.allocator(), fmt, args); } pub fn tmpJoinZ(separator: []const u8, slices: []const []const u8) ![:0]const u8 { fba.reset(); return try std.mem.joinZ(fba.allocator(), separator, slices); }