diff options
| author | 2024-07-26 17:26:39 +0300 | |
|---|---|---|
| committer | 2024-07-26 17:26:39 +0300 | |
| commit | 00a07a4de190edfad5f16e22e238c4b5c37e2cba (patch) | |
| tree | 39775a032e116ccdf2e0412bcf979dc773d330c4 /src/utils.zig | |
| parent | Respect request to wait on submitting requests (diff) | |
| download | ukkobot-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 | |||
| 18 | pub inline fn isNull(value: anytype) bool { | ||
| 19 | return switch (@typeInfo(@TypeOf(value))) { | ||
| 20 | .Null => true, | ||
| 21 | .Optional => value == null, | ||
| 22 | else => false, | ||
| 23 | }; | ||
| 24 | } | ||