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); +} 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); } },