authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-27 15:50:27 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-27 15:50:27 -08:00
log27dd9c8d9e35e88225ac91052b94cba43d185aba
tree0d01511e055a7d0cc7fa27bf8b3f3012db117ac7
parenteeb1c87f499416bd08c8ba4896f616a3cb6f7d77

add jsonStringify support


1 files changed, 2 insertions(+), 0 deletions(-)

ulid.zig+2
...@@ -36,6 +36,8 @@ pub const ULID = struct {...@@ -36,6 +36,8 @@ pub const ULID = struct {
3636
37 pub const BaseType = string;37 pub const BaseType = string;
3838
39 usingnamespace extras.StringerJsonStringifyMixin(@This());
40
39 pub fn parse(alloc: std.mem.Allocator, value: BaseType) !ULID {41 pub fn parse(alloc: std.mem.Allocator, value: BaseType) !ULID {
40 if (value.len != 26) return error.Ulid;42 if (value.len != 26) return error.Ulid;
41 return ULID{43 return ULID{