commit 755a3d957c644a560f37fe5e7be032b2cd86aaa1 (tree) parent e5c2df9f17571136d0769580d6250db0b1a8d0ca Author: meowjesty <43983236+meowjesty@users.noreply.github.com> Date: Sun, 23 Nov 2025 15:32:05 -0300 langref: convert to unmanaged `ArrayList` in example Diffstat:
| M | doc/langref/testing_detect_leak.zig | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/doc/langref/testing_detect_leak.zig b/doc/langref/testing_detect_leak.zig @@ -1,9 +1,10 @@ const std = @import("std"); test "detect leak" { - var list = std.array_list.Managed(u21).init(std.testing.allocator); - // missing `defer list.deinit();` - try list.append('☔'); + const gpa = std.testing.allocator; + var list: std.ArrayList(u21) = .empty; + // missing `defer list.deinit(gpa);` + try list.append(gpa, '☔'); try std.testing.expect(list.items.len == 1); }