Use .empty for initialization.

Co-authored-by: Rue <78876133+IOKG04@users.noreply.github.com>
This commit is contained in:
meowjesty 2025-11-22 22:18:27 -03:00 committed by GitHub
parent 9b83c6713a
commit 6bcf0066b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@ const std = @import("std");
test "detect leak" {
const allocator = std.testing.allocator;
var list = try std.ArrayList(u21).initCapacity(allocator, 1);
var list: std.ArrayList(u21) = .empty;
// missing `defer list.deinit(allocator);`
try list.append(allocator, '☔');