aboutsummaryrefslogblamecommitdiffstats
path: root/src/User.zig
blob: 5b78feca6a4f01001ec611b364423d25ab6cfef5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                           
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);
}