Skip to content

Conversation

@karlseguin
Copy link
Collaborator

No description provided.

pub fn get_hostname(self: *parser.Anchor, page: *Page) ![]const u8 {
var u = try url(self, page);
return try page.arena.dupe(u8, u.get_hostname());
return u.get_hostname();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could construct the url here with .if_needed, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole URL constructing per getter is a bit much. I guess it isn't called too often, plus it's maybe just as likely to get mutated.

Everything touching URLs needs a rewrite at some point. It's a bit of a mess, starting with std.Uri.

@karlseguin karlseguin merged commit 9c2e3e2 into main Jun 3, 2025
11 checks passed
@karlseguin karlseguin deleted the fix_anchor_href branch June 3, 2025 02:47
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants