From fecd95d8ec6f9a11ba03fd85b951dd11c33962cb Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Wed, 26 Apr 2023 17:42:41 -0700 Subject: [PATCH] readFile: leave this comment so that i dont try re-adding it later --- src/lib.zig | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index 7f26d07d2667c537e0e58619289ae34bd3337f47..6d399e6f0cb46c82a122afd9cd54c764b56acce8 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -450,12 +450,10 @@ pub fn readBytesAlloc(reader: anytype, alloc: std.mem.Allocator, len: usize) ![] } pub fn readFile(dir: std.fs.Dir, sub_path: string, alloc: std.mem.Allocator) !string { - var file = try dir.openFile(sub_path, .{}); - defer file.close(); - const stat = try file.stat(); - var buffer = try std.ArrayList(u8).initCapacity(alloc, stat.size); - pipe(file.reader(), buffer.writer()) catch @panic("unreachable"); // did the filesystem lie? - return buffer.items; + _ = dir; + _ = sub_path; + _ = alloc; + @compileError("use std.fs.Dir.readFileAlloc instead"); } pub fn nullifyS(s: ?string) ?string { -- 2.54.0