@@ -192,8 +192,8 @@ const TripItem = union(enum) {
192192 // Oops! The hermit forgot how to capture the union values
193193 // in a switch statement. Please capture each value as
194194 // 'p' so the print statements work!
195- .place = > print ("{s}" , .{p .name }),
196- .path = > print ("--{}->" , .{p .dist }),
195+ .place = > | p | print ("{s}" , .{p .name }),
196+ .path = > | p | print ("--{}->" , .{p .dist }),
197197 }
198198 }
199199};
@@ -255,7 +255,7 @@ const HermitsNotebook = struct {
255255 // dereference and optional value "unwrapping" look
256256 // together. Remember that you return the address with the
257257 // "&" operator.
258- if (place == entry .*.? .place ) return entry ;
258+ if (place == entry .*.? .place ) return & entry .*.? ;
259259 // Try to make your answer this long:__________;
260260 }
261261 return null ;
@@ -309,7 +309,7 @@ const HermitsNotebook = struct {
309309 //
310310 // Looks like the hermit forgot something in the return value of
311311 // this function. What could that be?
312- fn getTripTo (self : * HermitsNotebook , trip : []? TripItem , dest : * Place ) void {
312+ fn getTripTo (self : * HermitsNotebook , trip : []? TripItem , dest : * Place ) TripError ! void {
313313 // We start at the destination entry.
314314 const destination_entry = self .getEntry (dest );
315315
0 commit comments