One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): pub fn HyperLogLog(comptime p: u8) type { return struct { dense: []u6, const Self = @This(); pub fn init(allocator: Allocator) !Self { return Self{ .dense = try allocator.alloc(u6, 0), }; } } } To this: pub fn HyperLogLog(comptime p: u8) type { return struct { dense: […
https://github.com/redis/redis/blob/unstable/src/hyperloglog...