Zig's std.json.parseFormSlice and std.json.Parsed(T)

from blog openmymind.net, | ↗ original
In Zig's discord server, I see a steady stream of developers new to Zig struggling with parsing JSON. I like helping with this problem because you can learn a lot about Zig through it. A typical, but incorrect, first attempt looks something like: const std = @import("std"); const Allocator = std.mem.Allocator; const Config = struct { db_path:...