aboutsummaryrefslogtreecommitdiff
path: root/src/eval/html/Root.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-30 17:56:55 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-30 17:56:55 +0200
commita13df3ca580dc31544ef092d5d37e18089af3517 (patch)
treecfcf8c1d8322ee8e97783e263105eac9f5c00f33 /src/eval/html/Root.zig
parent5ecd48d4b9f928beb4143f88e802ee4d9e25a2bd (diff)
refactor(element): generalize element creation
Diffstat (limited to 'src/eval/html/Root.zig')
-rw-r--r--src/eval/html/Root.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval/html/Root.zig b/src/eval/html/Root.zig
index 6c4c37a..af130d1 100644
--- a/src/eval/html/Root.zig
+++ b/src/eval/html/Root.zig
@@ -28,7 +28,7 @@ pub fn deinit(self: *Self) void {
}
pub fn element(self: *Self) Element {
- return (Element.Wrapper(Self){ .ptr = self }).element();
+ return Element.Wrapper(Self, render).init(self);
}
pub fn allocator(self: *Self) Allocator {
@@ -50,7 +50,7 @@ fn fromNode(context: *anyopaque) Element {
return self.element();
}
-pub fn render(self: *Self, alloc: Allocator) Error![]const u8 {
+fn render(self: *Self, alloc: Allocator) Error![]const u8 {
if (self.content.first == null) return "";
var acc = try std.ArrayList(u8).initCapacity(alloc, 8);
errdefer acc.deinit(alloc);