mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 14:03:10 -05:00
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`.
This commit is contained in:
parent
4ae67ebf1b
commit
bb42451b0f
1 changed files with 5 additions and 5 deletions
10
build.zig
10
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});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue