diff --git a/src/lib.zig b/src/lib.zig index 2d36cc7ee9b4d04d475e55eb00e7aee61d6c3994..c87b82d47a866b63a4710736ca94a66ab7de2146 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -239,6 +239,9 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val if (comptime extras.isSlice(@TypeOf(x, y))) { return try doif(alloc, writer, body, bottom, data, ctx, opts, std.mem.eql(u8, x, y)); } + if (@typeInfo(@TypeOf(x)) == .@"struct") { + return doif(alloc, writer, body, bottom, data, ctx, opts, x.eql(y)); + } try doif(alloc, writer, body, bottom, data, ctx, opts, x == y); }, .ifnotequal => { @@ -250,6 +253,9 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val if (comptime extras.isSlice(@TypeOf(x, y))) { return try doif(alloc, writer, body, bottom, data, ctx, opts, !std.mem.eql(u8, x, y)); } + if (@typeInfo(@TypeOf(x)) == .@"struct") { + return doif(alloc, writer, body, bottom, data, ctx, opts, !x.eql(y)); + } try doif(alloc, writer, body, bottom, data, ctx, opts, x != y); }, }