From 3ffc9de9efd3b3650eaf3ccc77e434fa000a9a08 Mon Sep 17 00:00:00 2001 From: Orfeas <38209077+0xfea5@users.noreply.github.com> Date: Thu, 7 Dec 2023 06:56:53 +0200 Subject: day5 --- day02/solution.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'day02') diff --git a/day02/solution.zig b/day02/solution.zig index 5e8d6f6..b40274d 100644 --- a/day02/solution.zig +++ b/day02/solution.zig @@ -45,10 +45,10 @@ pub fn parseBall(text: []const u8) Ball { const trimmed = mem.trim(u8, text, &std.ascii.whitespace); var splitBalls = mem.splitScalar(u8, trimmed, ' '); - const nballs = std.fmt.parseInt(u64, splitBalls.next() orelse unreachable, 10) catch unreachable; + const nballs = std.fmt.parseInt(u64, splitBalls.next().?, 10) catch unreachable; var color: Color = undefined; color = blk: { - const s = splitBalls.next() orelse unreachable; + const s = splitBalls.next().?; if (mem.eql(u8, s, "red")) { break :blk .red; @@ -152,7 +152,7 @@ pub fn main() !void { var splitGame = mem.splitScalar(u8, line, ':'); _ = splitGame.next(); - const game = try parseGame(splitGame.next() orelse unreachable); + const game = try parseGame(splitGame.next().?); try games.append(game); } -- cgit v1.2.3