From fa0a621b12f1420ef6fed39c6d17c7907774eb6e Mon Sep 17 00:00:00 2001 From: iddev5 Date: Sun, 9 Apr 2023 20:10:51 +0530 Subject: [PATCH 1/2] Update to Zig master --- s2s.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s2s.zig b/s2s.zig index af37271..4d4d3c8 100644 --- a/s2s.zig +++ b/s2s.zig @@ -381,7 +381,7 @@ fn recursiveFree(allocator: std.mem.Allocator, comptime T: type, value: *T) void } }, .Array => |arr| { - for (value.*) |*item| { + for (value) |*item| { recursiveFree(allocator, arr.child, item); } }, From 4152c5953490482e977e96fa69827caa940b5258 Mon Sep 17 00:00:00 2001 From: iddev5 Date: Sun, 9 Apr 2023 20:12:18 +0530 Subject: [PATCH 2/2] Added build.zig file for tests and package manager --- build.zig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 build.zig diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..985e427 --- /dev/null +++ b/build.zig @@ -0,0 +1,19 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const optimize = b.standardOptimizeOption(.{}); + const target = b.standardTargetOptions(.{}); + + _ = b.addModule("s2s", .{ + .source_file = .{ .path = "s2s.zig" }, + }); + + const tests = b.addTest(.{ + .root_source_file = .{ .path = "s2s.zig" }, + .target = target, + .optimize = optimize, + }); + + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&tests.step); +}