From a84d698f9a449e08b383f97d1fb81a206186da26 Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Thu, 23 Nov 2023 21:35:56 +0100 Subject: use @hasField --- sqlite.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlite.zig b/sqlite.zig index 3759884..8477151 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -1349,7 +1349,7 @@ pub fn Iterator(comptime Type: type) type { if (!comptime isStruct(@TypeOf(options))) { @compileError("options passed to readPointer must be a struct"); } - if (!comptime std.meta.trait.hasField("allocator")(@TypeOf(options))) { + if (!@hasField(@TypeOf(options), "allocator")) { @compileError("options passed to readPointer must have an allocator field"); } @@ -1448,13 +1448,13 @@ pub fn Iterator(comptime Type: type) type { return switch (FieldType) { Blob => blk: { - if (!comptime std.meta.trait.hasField("allocator")(@TypeOf(options))) { + if (!@hasField(@TypeOf(options), "allocator")) { @compileError("options passed to readPointer must have an allocator field when reading a Blob"); } break :blk try self.readBytes(Blob, options.allocator, i, .Blob); }, Text => blk: { - if (!comptime std.meta.trait.hasField("allocator")(@TypeOf(options))) { + if (!@hasField(@TypeOf(options), "allocator")) { @compileError("options passed to readField must have an allocator field when reading a Text"); } break :blk try self.readBytes(Text, options.allocator, i, .Text); -- cgit v1.2.3