Skip to content

Commit b80a148

Browse files
committed
Use zig 0.9.0
1 parent a77b2b6 commit b80a148

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.tool-versions

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
zig 0.8.0
2-
1+
zig 0.9.0

src/main.zig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ const USAGE =
2727

2828
pub fn main() anyerror!void {
2929
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
30+
var alloc = arena.allocator();
3031
defer arena.deinit();
3132
var buf: [MAX_PATH_BYTES]u8 = undefined;
3233

33-
const findup = initFindup(&arena.allocator) catch |err| {
34+
const findup = initFindup(alloc) catch |err| {
3435
try stderr.print("ERROR: {e}\n{s}", .{ err, USAGE });
3536
std.os.exit(1);
3637
};
@@ -59,11 +60,11 @@ pub fn main() anyerror!void {
5960
try stdout.print("{s}\n", .{result.?});
6061
}
6162

62-
fn initFindup(allocator: *std.mem.Allocator) anyerror!Findup {
63+
fn initFindup(alloc: std.mem.Allocator) anyerror!Findup {
6364
var args = std.process.args();
6465

65-
const program = try args.next(allocator).?;
66-
const maybeTarget = args.next(allocator);
66+
const program = try args.next(alloc).?;
67+
const maybeTarget = args.next(alloc);
6768
const target = if (maybeTarget == null) return FindupError.NoFileSpecified else try maybeTarget.?;
6869
const cwd = std.fs.cwd();
6970

0 commit comments

Comments
 (0)