summaryrefslogtreecommitdiff
path: root/src/json.zig
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-07-22 08:23:22 +0300
committerGravatar Uko Kokņevičs2025-07-22 08:23:22 +0300
commit1d1df7b540721d58db174764a0f720e3c638a67b (patch)
tree44bbfc972dac04e32729a3065c90dea0334149d8 /src/json.zig
parentreplace trimming with just checking if the string is whitespace (diff)
downloadukkobot-1d1df7b540721d58db174764a0f720e3c638a67b.tar.gz
ukkobot-1d1df7b540721d58db174764a0f720e3c638a67b.tar.xz
ukkobot-1d1df7b540721d58db174764a0f720e3c638a67b.zip
Whitelist allowed inline bots
Also update to Zig 0.14.1 Also don't send the animations rn
Diffstat (limited to 'src/json.zig')
-rw-r--r--src/json.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/json.zig b/src/json.zig
index 9252344..ff07531 100644
--- a/src/json.zig
+++ b/src/json.zig
@@ -50,7 +50,7 @@ pub fn makeJsonParseFromValue(T: type) JsonParseFromValue(T) {
50 50
51pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonParseFromValue(T) { 51pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonParseFromValue(T) {
52 const union_info = switch (@typeInfo(T)) { 52 const union_info = switch (@typeInfo(T)) {
53 .Union => |info| blk: { 53 .@"union" => |info| blk: {
54 if (info.tag_type == null) { 54 if (info.tag_type == null) {
55 @compileError("Only tagged unions supported, got '" ++ @typeName(T) ++ "'"); 55 @compileError("Only tagged unions supported, got '" ++ @typeName(T) ++ "'");
56 } 56 }
@@ -62,12 +62,12 @@ pub fn makeJsonParseFromValueWithTag(T: type, comptime tag: [:0]const u8) JsonPa
62 const TagType = union_info.tag_type.?; 62 const TagType = union_info.tag_type.?;
63 63
64 const Base = blk: { 64 const Base = blk: {
65 const info = std.builtin.Type{ .Struct = .{ 65 const info = std.builtin.Type{ .@"struct" = .{
66 .layout = .auto, 66 .layout = .auto,
67 .fields = &.{.{ 67 .fields = &.{.{
68 .name = tag, 68 .name = tag,
69 .type = TagType, 69 .type = TagType,
70 .default_value = null, 70 .default_value_ptr = null,
71 .is_comptime = false, 71 .is_comptime = false,
72 .alignment = 0, 72 .alignment = 0,
73 }}, 73 }},