| ... | @@ -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 | } |
| 451 | | 451 | |
| 452 | pub fn readFile(dir: std.fs.Dir, sub_path: string, alloc: std.mem.Allocator) !string { | 452 | pub 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 | } |
| 460 | | 458 | |
| 461 | pub fn nullifyS(s: ?string) ?string { | 459 | pub fn nullifyS(s: ?string) ?string { |