aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorManlio Perillo <[email protected]>2023-05-07 20:07:26 +0200
committerManlio Perillo <[email protected]>2023-05-09 11:07:22 +0200
commitbb42451b0f6c6ce9b53ee7959a52cfc6cef0e19c (patch)
treeda0e4793e8a97bf65a608ef1058c1c37d4829f86 /build.zig
parent4ae67ebf1b7027cf33ecd96317d745ccf54987fb (diff)
downloadziglings-bb42451b0f6c6ce9b53ee7959a52cfc6cef0e19c.tar.xz
ziglings-bb42451b0f6c6ce9b53ee7959a52cfc6cef0e19c.zip
build: use self when using @fieldParentPtr
Update PrintStep and SkipStep to use the `self` variable when getting the parent pointer from Step. This convention is used in `std.Build`.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/build.zig b/build.zig
index e6f2688..0fc7ca5 100644
--- a/build.zig
+++ b/build.zig
@@ -616,9 +616,9 @@ const PrintStep = struct {
fn make(step: *Step, prog_node: *std.Progress.Node) !void {
_ = prog_node;
- const p = @fieldParentPtr(PrintStep, "step", step);
+ const self = @fieldParentPtr(PrintStep, "step", step);
- print("{s}", .{p.message});
+ print("{s}", .{self.message});
}
};
@@ -644,10 +644,10 @@ const SkipStep = struct {
fn make(step: *Step, prog_node: *std.Progress.Node) !void {
_ = prog_node;
- const p = @fieldParentPtr(SkipStep, "step", step);
+ const self = @fieldParentPtr(SkipStep, "step", step);
- if (p.exercise.skip) {
- print("{s} skipped\n", .{p.exercise.main_file});
+ if (self.exercise.skip) {
+ print("{s} skipped\n", .{self.exercise.main_file});
}
}
};