aboutsummaryrefslogtreecommitdiff
path: root/src/eval/list.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/list.zig')
-rw-r--r--src/eval/list.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/eval/list.zig b/src/eval/list.zig
index 160bde2..0b1306a 100644
--- a/src/eval/list.zig
+++ b/src/eval/list.zig
@@ -24,12 +24,7 @@ fn List(comptime tag: []const u8) type {
}
pub fn element(self: *Self) Element {
- return .{ .ptr = self, .vtable = .{ .html = html, .node = getNode } };
- }
-
- fn getNode(context: *anyopaque) *Node {
- const self: *Self = @ptrCast(@alignCast(context));
- return &self.node;
+ return Element.Wrapper(Self, html).init(self);
}
fn fromNode(context: *anyopaque) Element {
@@ -37,8 +32,7 @@ fn List(comptime tag: []const u8) type {
return self.element();
}
- fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML {
- const self: *Self = @ptrCast(@alignCast(context));
+ fn html(self: *Self, alloc: Allocator) HTML.Error!HTML {
var el = try HTML.Content.init(alloc, tag);
var root = try HTML.Root.init(alloc);
el.content = root.element();