aboutsummaryrefslogtreecommitdiff
path: root/src/eval/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/html')
-rw-r--r--src/eval/html/Element.zig4
-rw-r--r--src/eval/html/Root.zig2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/eval/html/Element.zig b/src/eval/html/Element.zig
index c6197b8..52ee58d 100644
--- a/src/eval/html/Element.zig
+++ b/src/eval/html/Element.zig
@@ -16,8 +16,8 @@ pub fn Wrapper(comptime V: type) type {
if (!@hasField(V, "node")) @compileError("missing field 'node' for " ++ @typeName(V));
const nd = @FieldType(V, "node");
if (nd != Node) @compileError("invalid node's type: " ++ @typeName(nd) ++ ", want " ++ @typeName(Node));
- if (!@hasDecl(V, "element")) @compileError("missing declaration 'element' for " ++ @typeName(V));
- if (!@hasDecl(V, "render")) @compileError("missing declaration 'render' for " ++ @typeName(V));
+ if (!std.meta.hasMethod(V, "element")) @compileError("missing declaration 'element' for " ++ @typeName(V));
+ if (!std.meta.hasMethod(V, "render")) @compileError("missing declaration 'render' for " ++ @typeName(V));
}
return struct {
ptr: *V,
diff --git a/src/eval/html/Root.zig b/src/eval/html/Root.zig
index acfe82e..6c4c37a 100644
--- a/src/eval/html/Root.zig
+++ b/src/eval/html/Root.zig
@@ -39,7 +39,7 @@ pub fn append(self: *Self, raw: anytype) Error!void {
const el: Element = blk: {
const T = @TypeOf(raw);
if (T == Element) break :blk raw;
- if (@hasDecl(T, "html")) break :blk try raw.html(self.allocator());
+ if (std.meta.hasMethod(T, "html")) break :blk try raw.html(self.allocator());
@compileError("cannot convert " ++ @typeName(T) ++ " into " ++ @typeName(Element));
};
self.content.append(&el.node().node);