Commit 76e2764eb1
2025-08-28 13:20:35
1 parent
dcddbcaChanged files (1)
src
src/main.zig
@@ -1064,8 +1064,8 @@ fn buildOutputType(
}
} else if (mem.eql(u8, arg, "--dep")) {
var it = mem.splitScalar(u8, args_iter.nextOrFatal(), '=');
- const key = it.next().?;
- const value = it.next() orelse key;
+ const key = it.first();
+ const value = if (it.peek() != null) it.rest() else key;
if (mem.eql(u8, key, "std") and !mem.eql(u8, value, "std")) {
fatal("unable to import as '{s}': conflicts with builtin module", .{
key,
@@ -1084,8 +1084,8 @@ fn buildOutputType(
});
} else if (mem.startsWith(u8, arg, "-M")) {
var it = mem.splitScalar(u8, arg["-M".len..], '=');
- const mod_name = it.next().?;
- const root_src_orig = it.next();
+ const mod_name = it.first();
+ const root_src_orig = if (it.peek() != null) it.rest() else null;
try handleModArg(
arena,
mod_name,