From 74c8e2baf22c62b8015daf1b86e58fa4bf738bb4 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 25 Aug 2025 20:05:19 +0200 Subject: Update to Zig 0.15.1. --- src/cmd/sort.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cmd/sort.zig') diff --git a/src/cmd/sort.zig b/src/cmd/sort.zig index 79616e9..5f75734 100644 --- a/src/cmd/sort.zig +++ b/src/cmd/sort.zig @@ -10,12 +10,12 @@ pub const Sort = struct { pub fn eval(sort: Sort, ctx: CommandContext) !CommandStatus { _ = sort; - var lines = ArrayList([]const u8).init(ctx.allocator); + var lines = ArrayList([]const u8){}; defer { for (lines.items) |line| { ctx.allocator.free(line); } - lines.deinit(); + lines.deinit(ctx.allocator); } // Read input lines from unified input reader @@ -33,7 +33,7 @@ pub const Sort = struct { .source => { // Read from input redirection while (try reader.readLine(ctx.allocator)) |line| { - try lines.append(line); + try lines.append(ctx.allocator, line); } }, } @@ -46,11 +46,11 @@ pub const Sort = struct { }.lessThan); // Output sorted lines - var output_buffer = ArrayList(u8).init(ctx.allocator); - defer output_buffer.deinit(); + var output_buffer = ArrayList(u8){}; + defer output_buffer.deinit(ctx.allocator); for (lines.items) |line| { - try output_buffer.writer().print("{s}\n", .{line}); + try output_buffer.writer(ctx.allocator).print("{s}\n", .{line}); } var writer = ctx.output_writer; -- cgit v1.2.1