summaryrefslogtreecommitdiff
path: root/src/utils.zig
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2024-07-26 17:26:39 +0300
committerGravatar Uko Kokņevičs2024-07-26 17:26:39 +0300
commit00a07a4de190edfad5f16e22e238c4b5c37e2cba (patch)
tree39775a032e116ccdf2e0412bcf979dc773d330c4 /src/utils.zig
parentRespect request to wait on submitting requests (diff)
downloadukkobot-00a07a4de190edfad5f16e22e238c4b5c37e2cba.tar.gz
ukkobot-00a07a4de190edfad5f16e22e238c4b5c37e2cba.tar.xz
ukkobot-00a07a4de190edfad5f16e22e238c4b5c37e2cba.zip
Added msginfo command
Diffstat (limited to '')
-rw-r--r--src/utils.zig (renamed from src/textutils.zig)8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/textutils.zig b/src/utils.zig
index 41dd5f5..c6e8508 100644
--- a/src/textutils.zig
+++ b/src/utils.zig
@@ -14,3 +14,11 @@ pub fn escapeXml(writer: anytype, text: []const u8) !void {
14 }; 14 };
15 } 15 }
16} 16}
17
18pub inline fn isNull(value: anytype) bool {
19 return switch (@typeInfo(@TypeOf(value))) {
20 .Null => true,
21 .Optional => value == null,
22 else => false,
23 };
24}