change stitch alloc default to .always

This commit is contained in:
Karl Seguin
2025-06-02 19:24:08 +08:00
parent ac75f9bf57
commit 2ef7ea6512
3 changed files with 3 additions and 5 deletions

View File

@@ -451,7 +451,7 @@ pub const Page = struct {
// if a base path is given, we resolve src using base.
if (base) |_base| {
res_src = try URL.stitch(arena, src, _base, .{});
res_src = try URL.stitch(arena, src, _base, .{ .alloc = .if_needed });
}
var origin_url = &self.url;

View File

@@ -52,9 +52,7 @@ pub const URL = struct {
const arena = page.arena;
var raw: []const u8 = undefined;
if (base) |b| {
raw = try @import("../../url.zig").URL.stitch(arena, url, b, .{
.alloc = .always,
});
raw = try @import("../../url.zig").URL.stitch(arena, url, b, .{});
} else {
raw = try arena.dupe(u8, url);
}

View File

@@ -84,7 +84,7 @@ pub const URL = struct {
}
const StitchOpts = struct {
alloc: AllocWhen = .if_needed,
alloc: AllocWhen = .always,
const AllocWhen = enum {
always,