@@ -11,7 +11,9 @@ pub fn build(b: *std.Build) !void {
1111 const target = b .standardTargetOptions (.{});
1212 const optimize = b .standardOptimizeOption (.{});
1313
14- _ = b .addModule ("xev" , .{ .root_source_file = b .path ("src/main.zig" ) });
14+ _ = b .addModule ("xev" , .{
15+ .root_source_file = b .path ("src/main.zig" ),
16+ });
1517
1618 const emit_man = b .option (
1719 bool ,
@@ -170,8 +172,9 @@ fn buildBenchmarks(
170172 b : * std.Build ,
171173 target : std.Build.ResolvedTarget ,
172174) ! []const * Step.Compile {
173- var steps = std .ArrayList (* Step .Compile ).init (b .allocator );
174- defer steps .deinit ();
175+ const alloc = b .allocator ;
176+ var steps : std .ArrayList (* Step .Compile ) = .empty ;
177+ defer steps .deinit (alloc );
175178
176179 var dir = try std .fs .cwd ().openDir (try b .build_root .join (
177180 b .allocator ,
@@ -208,10 +211,10 @@ fn buildBenchmarks(
208211 exe .root_module .addImport ("xev" , b .modules .get ("xev" ).? );
209212
210213 // Store the mapping
211- try steps .append (exe );
214+ try steps .append (alloc , exe );
212215 }
213216
214- return try steps .toOwnedSlice ();
217+ return try steps .toOwnedSlice (alloc );
215218}
216219
217220fn buildExamples (
@@ -220,8 +223,9 @@ fn buildExamples(
220223 optimize : std.builtin.OptimizeMode ,
221224 c_lib_ : ? * Step.Compile ,
222225) ! []const * Step.Compile {
223- var steps = std .ArrayList (* Step .Compile ).init (b .allocator );
224- defer steps .deinit ();
226+ const alloc = b .allocator ;
227+ var steps : std .ArrayList (* Step .Compile ) = .empty ;
228+ defer steps .deinit (alloc );
225229
226230 var dir = try std .fs .cwd ().openDir (try b .build_root .join (
227231 b .allocator ,
@@ -287,15 +291,16 @@ fn buildExamples(
287291 };
288292
289293 // Store the mapping
290- try steps .append (exe );
294+ try steps .append (alloc , exe );
291295 }
292296
293- return try steps .toOwnedSlice ();
297+ return try steps .toOwnedSlice (alloc );
294298}
295299
296300fn manPages (b : * std.Build ) ! []const * Step {
297- var steps = std .ArrayList (* Step ).init (b .allocator );
298- defer steps .deinit ();
301+ const alloc = b .allocator ;
302+ var steps : std .ArrayList (* Step ) = .empty ;
303+ defer steps .deinit (alloc );
299304
300305 var dir = try std .fs .cwd ().openDir (try b .build_root .join (
301306 b .allocator ,
@@ -315,11 +320,11 @@ fn manPages(b: *std.Build) ![]const *Step {
315320 b .fmt ("docs/{s}" , .{entry .name }),
316321 ) });
317322
318- try steps .append (& b .addInstallFile (
323+ try steps .append (alloc , & b .addInstallFile (
319324 cmd .captureStdOut (),
320325 b .fmt ("share/man/man{s}/{s}" , .{ section , base }),
321326 ).step );
322327 }
323328
324- return try steps .toOwnedSlice ();
329+ return try steps .toOwnedSlice (alloc );
325330}
0 commit comments