| ... | @@ -114,19 +114,19 @@ pub fn list_contains_gen(comptime T: type, haystack: []const T, needle: T) bool | ... | @@ -114,19 +114,19 @@ pub fn list_contains_gen(comptime T: type, haystack: []const T, needle: T) bool |
| 114 | return false; | 114 | return false; |
| 115 | } | 115 | } |
| 116 | | 116 | |
| 117 | pub fn file_list(dpath: string) ![]const string { | 117 | pub fn file_list(alloc: *std.mem.Allocator, dpath: string) ![]const string { |
| 118 | var list = std.ArrayList(string).init(gpa); | 118 | var list = std.ArrayList(string).init(alloc); |
| 119 | defer list.deinit(); | 119 | defer list.deinit(); |
| 120 | | 120 | |
| 121 | const dir = try std.fs.cwd().openDir(dpath, .{ .iterate = true }); | 121 | const dir = try std.fs.cwd().openDir(dpath, .{ .iterate = true }); |
| 122 | var walk = try dir.walk(gpa); | 122 | var walk = try dir.walk(alloc); |
| 123 | defer walk.deinit(); | 123 | defer walk.deinit(); |
| 124 | while (true) { | 124 | while (true) { |
| 125 | if (try walk.next()) |entry| { | 125 | if (try walk.next()) |entry| { |
| 126 | if (entry.kind != .File) { | 126 | if (entry.kind != .File) { |
| 127 | continue; | 127 | continue; |
| 128 | } | 128 | } |
| 129 | try list.append(try gpa.dupe(u8, entry.path)); | 129 | try list.append(try alloc.dupe(u8, entry.path)); |
| 130 | } else { | 130 | } else { |
| 131 | break; | 131 | break; |
| 132 | } | 132 | } |