From aadc17292e015258f590e5695d47fcc53de21a18 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 17 Oct 2023 11:39:00 +0200 Subject: [PATCH] wpt: improve hashmap creation readability --- src/main_wpt.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main_wpt.zig b/src/main_wpt.zig index 1eca4cfd..eb00b3a1 100644 --- a/src/main_wpt.zig +++ b/src/main_wpt.zig @@ -25,10 +25,12 @@ const FileLoader = struct { const Self = @This(); fn new(alloc: std.mem.Allocator, path: []const u8) Self { + const files = std.StringHashMap([]const u8).init(alloc); + return Self{ .path = path, .alloc = alloc, - .files = std.StringHashMap([]const u8).init(alloc), + .files = files, }; } fn get(self: *Self, name: []const u8) ![]const u8 {