diff options
| author | r00ster <r00ster91@proton.me> | 2022-07-25 21:04:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-25 22:04:30 +0300 |
| commit | cff5d9c805aa3433cc2562c3cb29bd3201817214 (patch) | |
| tree | aa7bedeeb92523806f79887159d66b8b2934f375 /lib/std/net.zig | |
| parent | 2f34d06d01189ae6349e9c6341ba85ec50b92bb0 (diff) | |
| download | zig-cff5d9c805aa3433cc2562c3cb29bd3201817214.tar.gz zig-cff5d9c805aa3433cc2562c3cb29bd3201817214.zip | |
std.mem: add `first` method to `SplitIterator` and `SplitBackwardsIterator`
Diffstat (limited to 'lib/std/net.zig')
| -rw-r--r-- | lib/std/net.zig | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
