From 4dbc7b03bc559596c06a2c5717e44cf2d52553ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 19 Feb 2022 22:10:55 +0200 Subject: [PATCH] buffer is a pointer --- src/user.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/user.zig b/src/user.zig index 4168e7c..7751854 100644 --- a/src/user.zig +++ b/src/user.zig @@ -34,10 +34,10 @@ pub const UserWriter = struct { // function makes tests easier, and removes the Shell dependency of this // module. const shellIndexFnType = fn ([]const u8) ?u6; - appendTo: ArrayList(u8), + appendTo: *ArrayList(u8), shellIndexFn: shellIndexFnType, - pub fn init(appendTo: ArrayList(u8), shellIndexFn: shellIndexFnType) UserWriter { + pub fn init(appendTo: *ArrayList(u8), shellIndexFn: shellIndexFnType) UserWriter { return UserWriter{ .appendTo = appendTo, .shellIndexFn = shellIndexFn, @@ -98,7 +98,7 @@ test "construct PackedUser blob" { var buf = ArrayList(u8).init(testing.allocator); defer buf.deinit(); - var writer = UserWriter.init(buf, testShellIndex); + var writer = UserWriter.init(&buf, testShellIndex); const user1 = User{ .uid = 1000, .gid = 1000,