authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-28 03:52:03 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-28 03:52:03 -07:00
log2e97ffbdeda9c737f12b819fbf052b629cfbd6bd
tree9c02b410537a3fbfd8401a7d9db97d3fc1aa86c8
parentde9de0a7679d6e71e938f2807b7a792e302ef550

remove global allocator from u.list_remove


2 files changed, 4 insertions(+), 4 deletions(-)

src/util/funcs.zig+2-2
......@@ -150,8 +150,8 @@ pub fn run_cmd(alloc: *std.mem.Allocator, dir: ?string, args: []const string) !u
150150 return result.term.Exited;
151151}
152152
153pub fn list_remove(input: []string, search: string) ![]string {
154 var list = std.ArrayList(string).init(gpa);
153pub fn list_remove(alloc: *std.mem.Allocator, input: []string, search: string) ![]string {
154 var list = std.ArrayList(string).init(alloc);
155155 defer list.deinit();
156156 for (input) |item| {
157157 if (!std.mem.eql(u8, item, search)) {
src/util/modfile.zig+2-2
......@@ -118,8 +118,8 @@ pub const ModFile = struct {
118118 .c_include_dirs = try item.mapping.get_string_array(alloc, "c_include_dirs"),
119119 .c_source_flags = try item.mapping.get_string_array(alloc, "c_source_flags"),
120120 .c_source_files = try item.mapping.get_string_array(alloc, "c_source_files"),
121 .only_os = try u.list_remove(try u.split(alloc, item.mapping.get_string("only_os"), ","), ""),
122 .except_os = try u.list_remove(try u.split(alloc, item.mapping.get_string("except_os"), ","), ""),
121 .only_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("only_os"), ","), ""),
122 .except_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("except_os"), ","), ""),
123123 .yaml = item.mapping,
124124 .deps = try dep_list_by_name(alloc, item.mapping, "dependencies"),
125125 });