blob: 5b78feca6a4f01001ec611b364423d25ab6cfef5 (
plain) (
tree)
|
|
const Allocator = @import("std").mem.Allocator;
id: i32,
username: []const u8,
pub fn init(allocator: Allocator, id: i32, username: []const u8) !@This() {
return .{
.id = id,
.username = try allocator.dupe(u8, username),
};
}
pub fn deinit(self: @This(), allocator: Allocator) void {
allocator.free(self.username);
}
|