Skip to content

Commit 27857f2

Browse files
authored
fix: add check to multi-return option (#49)
1 parent 91973fd commit 27857f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

2023/08/jacksonmowry.v

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ fn main() {
1414
}
1515

1616
fn solver(filename string, part_2 bool) !i64 {
17-
directions, nodes := os.read_file(filename)!.split_once('\n\n')
17+
directions, nodes := os.read_file(filename)!.split_once('\n\n') or {
18+
return error('Failed to derive nodes from "${filename}"')
19+
}
1820
node_lines := nodes.split_into_lines()
1921
mut node_map := map[string]Node{}
2022
mut working_nodes := []string{}

0 commit comments

Comments
 (0)