mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.net.Ip6Address: format numerical scope id
This commit is contained in:
parent
32a1aabff7
commit
377a8b2a3b
2 changed files with 4 additions and 1 deletions
|
|
@ -747,6 +747,9 @@ pub const Ip6Address = extern struct {
|
|||
try w.writeAll(":");
|
||||
}
|
||||
}
|
||||
if (self.sa.scope_id != 0) {
|
||||
try w.print("%{}", .{self.sa.scope_id});
|
||||
}
|
||||
try w.print("]:{}", .{port});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ test "parse and render IPv6 addresses" {
|
|||
"2001:db8::",
|
||||
"::1234:5678",
|
||||
"2001:db8::1234:5678",
|
||||
"ff01::fb",
|
||||
"ff01::fb%1234",
|
||||
"::ffff:123.5.123.5",
|
||||
};
|
||||
for (ips, 0..) |ip, i| {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue