mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Use .empty for initialization.
Co-authored-by: Rue <78876133+IOKG04@users.noreply.github.com>
This commit is contained in:
parent
9b83c6713a
commit
6bcf0066b1
1 changed files with 1 additions and 1 deletions
|
|
@ -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, '☔');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue