Add missing try?

For some reason this compiled on mac but not linux?
This commit is contained in:
Tyler Hallada 2022-12-02 00:28:41 -05:00
parent 2d18112a9a
commit 1b78bd2980

View File

@ -38,7 +38,7 @@ pub fn solve_part2(data: []const u8) !usize {
} }
} }
var elves_slice = elves.toOwnedSlice(); var elves_slice = try elves.toOwnedSlice();
defer allocator.free(elves_slice); defer allocator.free(elves_slice);
std.sort.sort(usize, elves_slice, {}, comptime std.sort.desc(usize)); std.sort.sort(usize, elves_slice, {}, comptime std.sort.desc(usize));
return elves_slice[0] + elves_slice[1] + elves_slice[2]; return elves_slice[0] + elves_slice[1] + elves_slice[2];