diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-03 12:34:33 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-03 18:13:55 +0200 |
commit | feeba51940fa52835c69f22b7694ffeea8f1cc08 (patch) | |
tree | a009112fed29d74e1cad6bbc2062a89aa351a4af /build.zig | |
parent | 3ec978d73faa9db0fdbb60e4a3c0631f0923be48 (diff) |
build: don't use @This() in ZiglingStep
Use ZiglingStep, instead.
This is consistent with the coding style in std.Build.
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -228,8 +228,8 @@ const ZiglingStep = struct { result_messages: []const u8 = "", result_error_bundle: std.zig.ErrorBundle = std.zig.ErrorBundle.empty, - pub fn create(builder: *Build, exercise: Exercise, work_path: []const u8) *@This() { - const self = builder.allocator.create(@This()) catch unreachable; + pub fn create(builder: *Build, exercise: Exercise, work_path: []const u8) *ZiglingStep { + const self = builder.allocator.create(ZiglingStep) catch unreachable; self.* = .{ .step = Step.init(Step.Options{ .id = .custom, .name = exercise.main_file, .owner = builder, .makeFn = make }), .exercise = exercise, @@ -239,7 +239,7 @@ const ZiglingStep = struct { } fn make(step: *Step, prog_node: *std.Progress.Node) !void { - const self = @fieldParentPtr(@This(), "step", step); + const self = @fieldParentPtr(ZiglingStep, "step", step); if (self.exercise.skip) { print("Skipping {s}\n\n", .{self.exercise.main_file}); @@ -266,7 +266,7 @@ const ZiglingStep = struct { }; } - fn run(self: *@This(), exe_path: []const u8, _: *std.Progress.Node) !void { + fn run(self: *ZiglingStep, exe_path: []const u8, _: *std.Progress.Node) !void { resetLine(); print("Checking {s}...\n", .{self.exercise.main_file}); @@ -326,7 +326,7 @@ const ZiglingStep = struct { print("{s}PASSED:\n{s}{s}\n\n", .{ green_text, trimOutput, reset_text }); } - fn compile(self: *@This(), prog_node: *std.Progress.Node) ![]const u8 { + fn compile(self: *ZiglingStep, prog_node: *std.Progress.Node) ![]const u8 { print("Compiling {s}...\n", .{self.exercise.main_file}); const b = self.step.owner; |