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