| author | |
| committer | |
| log | e6ccf23520fb89e56a8a6c1a9c93b07d5177bba5 |
| tree | 69b09ddf5017f5559ebec7a5e8a84289a17c8dbe |
| parent | ad5ff90838b11586a34d8a1480609a4127980080 |
1 files changed, 9 insertions(+), 0 deletions(-)
src/util/funcs.zig+9| ... | ... | @@ -121,3 +121,12 @@ pub fn open_dir_absolute(dpath: []const u8) !std.fs.Dir { |
| 121 | 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 | } |