diff --git a/src/config.zig b/src/config.zig index 490db8f..27c6c24 100644 --- a/src/config.zig +++ b/src/config.zig @@ -63,8 +63,8 @@ pub fn parse(self: Self, reader: anytype) !ParsedConfig { errdefer rc.deinit(); while (try reader.readUntilDelimiterOrEofAlloc(self.allocator, '\n', std.math.maxInt(usize))) |line| { defer self.allocator.free(line); - const nocomments = std.mem.trim(u8, @constCast(&std.mem.split(u8, line, "#")).first(), ws); - var data_iterator = std.mem.split(u8, nocomments, "="); + const nocomments = std.mem.trim(u8, @constCast(&std.mem.splitScalar(u8, line, '#')).first(), ws); + var data_iterator = std.mem.splitScalar(u8, nocomments, '='); const key = std.mem.trim(u8, data_iterator.first(), ws); // first never fails if (key.len == 0) continue; const value = std.mem.trim(u8, data_iterator.next() orelse return error.NoValueForKey, ws); diff --git a/src/main.zig b/src/main.zig index 341b345..cc82e03 100644 --- a/src/main.zig +++ b/src/main.zig @@ -207,7 +207,7 @@ fn executorIsMatch(match_data: []const u8, requested_path: []const u8, headers: }; // Apparently std.mem.split will return an empty first when the haystack starts // with the delimiter - var split = std.mem.split(u8, std.mem.trim(u8, match_data[colon + 1 ..], "\t "), " "); + var split = std.mem.splitScalar(u8, std.mem.trim(u8, match_data[colon + 1 ..], "\t "), ' '); const header_value_needle = split.first(); const path_needle = split.next() orelse { std.log.warn(