Add missing cast to usize

This commit is contained in:
LemonBoy 2019-05-06 21:42:52 +02:00
parent 939ec878a0
commit a3beda27fc
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ pub fn readFileAllocAligned(allocator: *mem.Allocator, path: []const u8, comptim
var file = try File.openRead(path);
defer file.close();
const size = try file.getEndPos();
const size = try math.cast(usize, try file.getEndPos());
const buf = try allocator.alignedAlloc(u8, A, size);
errdefer allocator.free(buf);

View File

@ -748,7 +748,7 @@ fn renderExpression(
counting_stream.bytes_written = 0;
var dummy_col: usize = 0;
try renderExpression(allocator, &counting_stream.stream, tree, 0, &dummy_col, expr.*, Space.None);
const width = counting_stream.bytes_written;
const width = @intCast(usize, counting_stream.bytes_written);
const col = i % row_size;
column_widths[col] = std.math.max(column_widths[col], width);
expr_widths[i] = width;