From cff5d9c805aa3433cc2562c3cb29bd3201817214 Mon Sep 17 00:00:00 2001 From: r00ster Date: Mon, 25 Jul 2022 21:04:30 +0200 Subject: std.mem: add `first` method to `SplitIterator` and `SplitBackwardsIterator` --- lib/std/net.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std/net.zig') diff --git a/lib/std/net.zig b/lib/std/net.zig index c381df9bce..21fa36c4eb 100644 --- a/lib/std/net.zig +++ b/lib/std/net.zig @@ -1154,7 +1154,7 @@ fn linuxLookupNameFromHosts( else => |e| return e, }) |line| { var split_it = mem.split(u8, line, "#"); - const no_comment_line = split_it.next().?; + const no_comment_line = split_it.first(); var line_it = mem.tokenize(u8, no_comment_line, " \t"); const ip_text = line_it.next() orelse continue; @@ -1356,7 +1356,7 @@ fn getResolvConf(allocator: mem.Allocator, rc: *ResolvConf) !void { }) |line| { const no_comment_line = no_comment_line: { var split = mem.split(u8, line, "#"); - break :no_comment_line split.next().?; + break :no_comment_line split.first(); }; var line_it = mem.tokenize(u8, no_comment_line, " \t"); @@ -1364,7 +1364,7 @@ fn getResolvConf(allocator: mem.Allocator, rc: *ResolvConf) !void { if (mem.eql(u8, token, "options")) { while (line_it.next()) |sub_tok| { var colon_it = mem.split(u8, sub_tok, ":"); - const name = colon_it.next().?; + const name = colon_it.first(); const value_txt = colon_it.next() orelse continue; const value = std.fmt.parseInt(u8, value_txt, 10) catch |err| switch (err) { // TODO https://github.com/ziglang/zig/issues/11812 -- cgit v1.2.3