From: Brendan Hansen Date: Sun, 26 Feb 2023 04:51:17 +0000 (-0600) Subject: using result type in aoc-2021/day01 X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=160e66ed594ee6c7ddae2f5d628707a0adbb06e3;p=onyx.git using result type in aoc-2021/day01 --- diff --git a/tests/aoc-2021/day01.onyx b/tests/aoc-2021/day01.onyx index 8a67a4c8..bc106c9e 100644 --- a/tests/aoc-2021/day01.onyx +++ b/tests/aoc-2021/day01.onyx @@ -14,8 +14,7 @@ count_increasing :: (arr: [] $T) -> u32 { } main :: (args) => { - err, file := os.open("./tests/aoc-2021/input/day01.txt"); - assert(err == .None, "Error opening file"); + file := os.open("./tests/aoc-2021/input/day01.txt")->expect("Error opening file"); reader := io.reader_make(^file); defer os.close(^file);