mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-27 18:06:28 +00:00
Compare commits
No commits in common. "e2b20b3406720b8acb477087ca3060f2c2f48f2b" and "173af62d3402ad1b44e5596d9bcf3f0ea42e8a29" have entirely different histories.
e2b20b3406
...
173af62d34
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ const TripItem = union(enum) {
|
||||||
fn printMe(self: TripItem) void {
|
fn printMe(self: TripItem) void {
|
||||||
switch (self) {
|
switch (self) {
|
||||||
// Oops! The hermit forgot how to capture the union values
|
// Oops! The hermit forgot how to capture the union values
|
||||||
// in a switch statement. Please capture each value as
|
// in a switch statement. Please capture both values as
|
||||||
// 'p' so the print statements work!
|
// 'p' so the print statements work!
|
||||||
.place => print("{s}", .{p.name}),
|
.place => print("{s}", .{p.name}),
|
||||||
.path => print("--{}->", .{p.dist}),
|
.path => print("--{}->", .{p.dist}),
|
||||||
|
|
Loading…
Reference in a new issue