File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- zig 0.8.0
2-
1+ zig 0.9.0
Original file line number Diff line number Diff line change @@ -27,10 +27,11 @@ const USAGE =
2727
2828pub 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
You can’t perform that action at this time.
0 commit comments