From 6bd24af2ffbea91db1b10a5d5258980ce2068c7f Mon Sep 17 00:00:00 2001 From: sadbeast Date: Tue, 16 Jul 2024 18:16:29 -0700 Subject: let's go --- src/User.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/User.zig (limited to 'src/User.zig') 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; -- cgit v1.2.3