summaryrefslogtreecommitdiffstats
path: root/src/User.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/User.zig')
-rw-r--r--src/User.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/User.zig b/src/User.zig
new file mode 100644
index 0000000..7178a34
--- /dev/null
+++ b/src/User.zig
@@ -0,0 +1,13 @@
+id: i64,
+name: []const u8,
+
+pub const User = @This();
+
+pub fn init(allocator: Allocator, id: i64, name: []const u8) !User {
+ return .{
+ .id = id,
+ .name = try allocator.dupe(u8, name),
+ };
+}
+
+const Allocator = @import("std").mem.Allocator;