authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 17:42:41 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-04-26 17:42:41 -07:00
logfecd95d8ec6f9a11ba03fd85b951dd11c33962cb
treeb75023dae40f9a7c3752eaa91c33623101aa7835
parentbd487677bda80ecd701a7ab8ce9a2347bfbf5995

readFile: leave this comment so that i dont try re-adding it later


1 files changed, 4 insertions(+), 6 deletions(-)

src/lib.zig+4-6
...@@ -450,12 +450,10 @@ pub fn readBytesAlloc(reader: anytype, alloc: std.mem.Allocator, len: usize) ![]...@@ -450,12 +450,10 @@ pub fn readBytesAlloc(reader: anytype, alloc: std.mem.Allocator, len: usize) ![]
450}450}
451451
452pub fn readFile(dir: std.fs.Dir, sub_path: string, alloc: std.mem.Allocator) !string {452pub fn readFile(dir: std.fs.Dir, sub_path: string, alloc: std.mem.Allocator) !string {
453 var file = try dir.openFile(sub_path, .{});453 _ = dir;
454 defer file.close();454 _ = sub_path;
455 const stat = try file.stat();455 _ = alloc;
456 var buffer = try std.ArrayList(u8).initCapacity(alloc, stat.size);456 @compileError("use std.fs.Dir.readFileAlloc instead");
457 pipe(file.reader(), buffer.writer()) catch @panic("unreachable"); // did the filesystem lie?
458 return buffer.items;
459}457}
460458
461pub fn nullifyS(s: ?string) ?string {459pub fn nullifyS(s: ?string) ?string {