mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-26 01:20:30 +00:00
Compare commits
2 commits
173af62d34
...
e2b20b3406
Author | SHA1 | Date | |
---|---|---|---|
|
e2b20b3406 | ||
|
02478759b4 |
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ const TripItem = union(enum) {
|
|||
fn printMe(self: TripItem) void {
|
||||
switch (self) {
|
||||
// Oops! The hermit forgot how to capture the union values
|
||||
// in a switch statement. Please capture both values as
|
||||
// in a switch statement. Please capture each value as
|
||||
// 'p' so the print statements work!
|
||||
.place => print("{s}", .{p.name}),
|
||||
.path => print("--{}->", .{p.dist}),
|
||||
|
|
Loading…
Reference in a new issue