chore: remove magic numbers

This commit is contained in:
2022-04-13 21:39:35 -03:00
parent ffbb31c767
commit dfe94fb931
6 changed files with 17 additions and 29 deletions

View File

@@ -12,9 +12,7 @@ pub fn init(alloc: Allocator, maybe_path: ?[]const u8) !Self {
if (maybe_path) |path| {
const file = try std.fs.cwd().openFile(path, .{});
defer file.close();
const len = try file.getEndPos();
buf = try file.readToEndAlloc(alloc, len);
buf = try file.readToEndAlloc(alloc, try file.getEndPos());
}
return Self{