mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.Build: use create() instead of init() for Step.RemoveDir
This commit is contained in:
parent
809e7aa4fc
commit
b403ca0aab
@ -971,9 +971,7 @@ pub fn addWriteFiles(b: *Build) *Step.WriteFile {
|
||||
}
|
||||
|
||||
pub fn addRemoveDirTree(self: *Build, dir_path: []const u8) *Step.RemoveDir {
|
||||
const remove_dir_step = self.allocator.create(Step.RemoveDir) catch @panic("OOM");
|
||||
remove_dir_step.* = Step.RemoveDir.init(self, dir_path);
|
||||
return remove_dir_step;
|
||||
return Step.RemoveDir.create(self, dir_path);
|
||||
}
|
||||
|
||||
pub fn addFmt(b: *Build, options: Step.Fmt.Options) *Step.Fmt {
|
||||
|
||||
@ -8,8 +8,9 @@ pub const base_id = .remove_dir;
|
||||
step: Step,
|
||||
dir_path: []const u8,
|
||||
|
||||
pub fn init(owner: *std.Build, dir_path: []const u8) RemoveDir {
|
||||
return RemoveDir{
|
||||
pub fn create(owner: *std.Build, dir_path: []const u8) *RemoveDir {
|
||||
const self = owner.allocator.create(RemoveDir) catch @panic("OOM");
|
||||
self.* = .{
|
||||
.step = Step.init(.{
|
||||
.id = .remove_dir,
|
||||
.name = owner.fmt("RemoveDir {s}", .{dir_path}),
|
||||
@ -18,6 +19,7 @@ pub fn init(owner: *std.Build, dir_path: []const u8) RemoveDir {
|
||||
}),
|
||||
.dir_path = owner.dupePath(dir_path),
|
||||
};
|
||||
return self;
|
||||
}
|
||||
|
||||
fn make(step: *Step, prog_node: *std.Progress.Node) !void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user