authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-11-15 23:10:55 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-11-15 23:10:55 -08:00
logfd01da118ba52286a4775b6f0b2cad5445a56ba9
treecb64b035967a5cb52f25de2d1d9619d9b4e3c685
parent17443e2247975508c68204704c3614878cd0f9e6

remove `open` fn from `self/files` package

consumers can add it if they need it

1 files changed, 0 insertions(+), 10 deletions(-)

src/common.zig-10
...@@ -317,16 +317,6 @@ pub fn add_files_package(alloc: *std.mem.Allocator, pkg_name: string, mdir: std....@@ -317,16 +317,6 @@ pub fn add_files_package(alloc: *std.mem.Allocator, pkg_name: string, mdir: std.
317 while (iter.next()) |item| {317 while (iter.next()) |item| {
318 try w.print("pub const @\"/{}\" = @embedFile(srcpath ++ \"/{}\");\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) });318 try w.print("pub const @\"/{}\" = @embedFile(srcpath ++ \"/{}\");\n", .{ std.zig.fmtEscapes(item.key_ptr.*), std.zig.fmtEscapes(item.value_ptr.*) });
319 }319 }
320 try w.writeAll("\n");
321 try w.writeAll(
322 \\pub fn open(comptime path: string) ?string {
323 \\ if (path.len == 0) return null;
324 \\ if (path[0] != '/') return null;
325 \\ if (!@hasDecl(@This(), path)) return null;
326 \\ return @field(@This(), path);
327 \\}
328 \\
329 );
330320
331 var d: zigmod.Dep = .{321 var d: zigmod.Dep = .{
332 .alloc = alloc,322 .alloc = alloc,