authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 23:45:40 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 23:45:40 -07:00
log7503cd633d5900cc7e77a0b7c379dd8a786b6871
tree64eff59ca92a4cc9bbd9d4063827728e6d098c48
parent7a6abd6e2fd89a8553f624795b0524fa84ed1b9c
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.15.2


2 files changed, 10 insertions(+), 10 deletions(-)

README.md+1-1
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3![loc](https://sloc.xyz/github/nektro/zig-whatwg-url)3![loc](https://sloc.xyz/github/nektro/zig-whatwg-url)
4[![license](https://img.shields.io/github/license/nektro/zig-whatwg-url.svg)](https://github.com/nektro/zig-whatwg-url/blob/master/LICENSE)4[![license](https://img.shields.io/github/license/nektro/zig-whatwg-url.svg)](https://github.com/nektro/zig-whatwg-url/blob/master/LICENSE)
5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)
6[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/)6[![Zig](https://img.shields.io/badge/Zig-0.15-f7a41d)](https://ziglang.org/)
7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)
88
9A spec-compliant Zig implementation of WHATWG URL.9A spec-compliant Zig implementation of WHATWG URL.
url.zig+9-9
...@@ -47,7 +47,7 @@ pub const URL = struct {...@@ -47,7 +47,7 @@ pub const URL = struct {
47 // input is a scalar value string47 // input is a scalar value string
48 if (!std.unicode.utf8ValidateSlice(input)) return error.InvalidURL;48 if (!std.unicode.utf8ValidateSlice(input)) return error.InvalidURL;
4949
50 var inputl = std.ArrayList(u8).init(alloc);50 var inputl = std.array_list.Managed(u8).init(alloc);
51 defer inputl.deinit();51 defer inputl.deinit();
52 try inputl.appendSlice(input);52 try inputl.appendSlice(input);
5353
...@@ -70,7 +70,7 @@ pub const URL = struct {...@@ -70,7 +70,7 @@ pub const URL = struct {
70 // we always do utf-870 // we always do utf-8
7171
72 // 6.72 // 6.
73 var buffer = std.ArrayList(u8).init(alloc);73 var buffer = std.array_list.Managed(u8).init(alloc);
74 defer buffer.deinit();74 defer buffer.deinit();
7575
76 // 7.76 // 7.
...@@ -1138,9 +1138,9 @@ pub const SearchParams = struct {...@@ -1138,9 +1138,9 @@ pub const SearchParams = struct {
1138 return self.inner.len;1138 return self.inner.len;
1139 }1139 }
11401140
1141 pub fn encode(self: *const SearchParams) !string {1141 pub fn encode(self: *const SearchParams) ![]u8 {
1142 const alloc = self.allocator;1142 const alloc = self.allocator;
1143 var list = std.ArrayList(u8).init(alloc);1143 var list = std.array_list.Managed(u8).init(alloc);
1144 errdefer list.deinit();1144 errdefer list.deinit();
1145 for (self.inner.items(.key), self.inner.items(.value), 0..) |k, v, i| {1145 for (self.inner.items(.key), self.inner.items(.value), 0..) |k, v, i| {
1146 if (i > 0) try list.writer().writeAll("&");1146 if (i > 0) try list.writer().writeAll("&");
...@@ -1458,7 +1458,7 @@ fn parseHostOpaque(allocator: std.mem.Allocator, input: []const u8) ![]const u8...@@ -1458,7 +1458,7 @@ fn parseHostOpaque(allocator: std.mem.Allocator, input: []const u8) ![]const u8
1458/// https://url.spec.whatwg.org/#utf-8-percent-encode1458/// https://url.spec.whatwg.org/#utf-8-percent-encode
1459fn percentEncode(allocator: std.mem.Allocator, input: []const u8, comptime set: fn (u8) bool) ![]u8 {1459fn percentEncode(allocator: std.mem.Allocator, input: []const u8, comptime set: fn (u8) bool) ![]u8 {
1460 if (!extras.matchesAny(u8, input, set)) return allocator.dupe(u8, input);1460 if (!extras.matchesAny(u8, input, set)) return allocator.dupe(u8, input);
1461 var result = std.ArrayList(u8).init(allocator);1461 var result = std.array_list.Managed(u8).init(allocator);
1462 errdefer result.deinit();1462 errdefer result.deinit();
1463 try result.ensureUnusedCapacity(input.len);1463 try result.ensureUnusedCapacity(input.len);
1464 try percentEncodeAL(&result, input, set);1464 try percentEncodeAL(&result, input, set);
...@@ -1467,7 +1467,7 @@ fn percentEncode(allocator: std.mem.Allocator, input: []const u8, comptime set:...@@ -1467,7 +1467,7 @@ fn percentEncode(allocator: std.mem.Allocator, input: []const u8, comptime set:
14671467
1468/// https://url.spec.whatwg.org/#string-percent-decode1468/// https://url.spec.whatwg.org/#string-percent-decode
1469pub fn percentDecode(allocator: std.mem.Allocator, input: []const u8) ![]u8 {1469pub fn percentDecode(allocator: std.mem.Allocator, input: []const u8) ![]u8 {
1470 var result = std.ArrayList(u8).init(allocator);1470 var result = std.array_list.Managed(u8).init(allocator);
1471 errdefer result.deinit();1471 errdefer result.deinit();
1472 try result.ensureUnusedCapacity(input.len);1472 try result.ensureUnusedCapacity(input.len);
1473 try percentDecodeW(result.writer(), input);1473 try percentDecodeW(result.writer(), input);
...@@ -1792,7 +1792,7 @@ fn lastcpi(haystack: []const u8) usize {...@@ -1792,7 +1792,7 @@ fn lastcpi(haystack: []const u8) usize {
1792 while (haystack[i] & 0xC0 == 0x80) : (i -= 1) {}1792 while (haystack[i] & 0xC0 == 0x80) : (i -= 1) {}
1793 return i;1793 return i;
1794}1794}
1795pub fn percentEncodeScalarAL(list: *std.ArrayList(u8), cp: []const u8, comptime set: fn (u8) bool) !void {1795pub fn percentEncodeScalarAL(list: *std.array_list.Managed(u8), cp: []const u8, comptime set: fn (u8) bool) !void {
1796 if (set(cp[0])) {1796 if (set(cp[0])) {
1797 for (cp) |b| {1797 for (cp) |b| {
1798 try list.append('%');1798 try list.append('%');
...@@ -1815,7 +1815,7 @@ pub fn percentEncodeW(writer: anytype, input: []const u8, comptime set: fn (u8)...@@ -1815,7 +1815,7 @@ pub fn percentEncodeW(writer: anytype, input: []const u8, comptime set: fn (u8)
1815 }1815 }
1816 }1816 }
1817}1817}
1818pub fn percentEncodeAL(list: *std.ArrayList(u8), input: []const u8, comptime set: fn (u8) bool) !void {1818pub fn percentEncodeAL(list: *std.array_list.Managed(u8), input: []const u8, comptime set: fn (u8) bool) !void {
1819 var it = std.unicode.Utf8View.initUnchecked(input).iterator();1819 var it = std.unicode.Utf8View.initUnchecked(input).iterator();
1820 while (it.nextCodepointSlice()) |sl| {1820 while (it.nextCodepointSlice()) |sl| {
1821 if (set(sl[0])) {1821 if (set(sl[0])) {
...@@ -1927,7 +1927,7 @@ fn nthScalarItem(T: type, haystack: []const u8, needle: T, index: usize) []const...@@ -1927,7 +1927,7 @@ fn nthScalarItem(T: type, haystack: []const u8, needle: T, index: usize) []const
19271927
1928pub fn ManyArrayList(N: usize, T: type) type {1928pub fn ManyArrayList(N: usize, T: type) type {
1929 return struct {1929 return struct {
1930 list: std.ArrayList(T),1930 list: std.array_list.Managed(T),
1931 lengths: [N]usize,1931 lengths: [N]usize,
19321932
1933 pub fn init(allocator: std.mem.Allocator) @This() {1933 pub fn init(allocator: std.mem.Allocator) @This() {