| ... | @@ -121,3 +121,12 @@ pub fn open_dir_absolute(dpath: []const u8) !std.fs.Dir { | ... | @@ -121,3 +121,12 @@ pub fn open_dir_absolute(dpath: []const u8) !std.fs.Dir { |
| 121 | .fd = (try std.fs.openFileAbsolute(dpath, .{})).handle, | 121 | .fd = (try std.fs.openFileAbsolute(dpath, .{})).handle, |
| 122 | }; | 122 | }; |
| 123 | } | 123 | } |
| | 124 | |
| | 125 | pub fn list_contains_gen(comptime T: type, haystack: *std.ArrayList(T), needle: T) bool { |
| | 126 | for (haystack.items) |item| { |
| | 127 | if (item.eql(needle)) { |
| | 128 | return true; |
| | 129 | } |
| | 130 | } |
| | 131 | return false; |
| | 132 | } |