| ... | @@ -1563,7 +1563,7 @@ fn lastcpi(haystack: []const u8) usize { | ... | @@ -1563,7 +1563,7 @@ fn lastcpi(haystack: []const u8) usize { |
| 1563 | while (haystack[i] & 0xC0 == 0x80) : (i -= 1) {} | 1563 | while (haystack[i] & 0xC0 == 0x80) : (i -= 1) {} |
| 1564 | return i; | 1564 | return i; |
| 1565 | } | 1565 | } |
| 1566 | fn percentEncodeScalarAL(list: *std.ArrayList(u8), cp: []const u8, comptime set: fn (u8) bool) !void { | 1566 | pub fn percentEncodeScalarAL(list: *std.ArrayList(u8), cp: []const u8, comptime set: fn (u8) bool) !void { |
| 1567 | if (set(cp[0])) { | 1567 | if (set(cp[0])) { |
| 1568 | for (cp) |b| { | 1568 | for (cp) |b| { |
| 1569 | try list.append('%'); | 1569 | try list.append('%'); |
| ... | @@ -1573,7 +1573,7 @@ fn percentEncodeScalarAL(list: *std.ArrayList(u8), cp: []const u8, comptime set: | ... | @@ -1573,7 +1573,7 @@ fn percentEncodeScalarAL(list: *std.ArrayList(u8), cp: []const u8, comptime set: |
| 1573 | try list.append(cp[0]); | 1573 | try list.append(cp[0]); |
| 1574 | } | 1574 | } |
| 1575 | } | 1575 | } |
| 1576 | fn percentEncodeAL(list: *std.ArrayList(u8), input: []const u8, comptime set: fn (u8) bool) !void { | 1576 | pub fn percentEncodeAL(list: *std.ArrayList(u8), input: []const u8, comptime set: fn (u8) bool) !void { |
| 1577 | var it = std.unicode.Utf8View.initUnchecked(input).iterator(); | 1577 | var it = std.unicode.Utf8View.initUnchecked(input).iterator(); |
| 1578 | while (it.nextCodepointSlice()) |sl| { | 1578 | while (it.nextCodepointSlice()) |sl| { |
| 1579 | if (set(sl[0])) { | 1579 | if (set(sl[0])) { |
| ... | @@ -1659,7 +1659,7 @@ fn setHost(href: *ManyArrayList(15, u8), h: URL.Host) !void { | ... | @@ -1659,7 +1659,7 @@ fn setHost(href: *ManyArrayList(15, u8), h: URL.Host) !void { |
| 1659 | }, | 1659 | }, |
| 1660 | } | 1660 | } |
| 1661 | } | 1661 | } |
| 1662 | pub fn replaceInPlace(comptime T: type, input: []T, needle: []const T, replacement: []const T) usize { | 1662 | fn replaceInPlace(comptime T: type, input: []T, needle: []const T, replacement: []const T) usize { |
| 1663 | // Empty needle will loop until output buffer overflows. | 1663 | // Empty needle will loop until output buffer overflows. |
| 1664 | std.debug.assert(needle.len > 0); | 1664 | std.debug.assert(needle.len > 0); |
| 1665 | std.debug.assert(needle.len >= replacement.len); | 1665 | std.debug.assert(needle.len >= replacement.len); |