mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-07-29 10:45:14 +00:00
changed the patch files that we can also use them with busybox for testing in Woodpecker
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
195,196c195,196
|
||||
< .place => print("{s}", .{p.name}),
|
||||
< .path => print("--{}->", .{p.dist}),
|
||||
---
|
||||
> .place => |p| print("{s}", .{p.name}),
|
||||
> .path => |p| print("--{}->", .{p.dist}),
|
||||
258c258
|
||||
< if (place == entry.*.?.place) return entry;
|
||||
---
|
||||
> if (place == entry.*.?.place) return &entry.*.?;
|
||||
312c312
|
||||
< fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) void {
|
||||
---
|
||||
> fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) TripError!void {
|
||||
--- exercises/058_quiz7.zig 2023-10-03 22:15:22.125574535 +0200
|
||||
+++ answers/058_quiz7.zig 2023-10-05 20:04:07.106101152 +0200
|
||||
@@ -192,8 +192,8 @@
|
||||
// Oops! The hermit forgot how to capture the union values
|
||||
// in a switch statement. Please capture both values as
|
||||
// 'p' so the print statements work!
|
||||
- .place => print("{s}", .{p.name}),
|
||||
- .path => print("--{}->", .{p.dist}),
|
||||
+ .place => |p| print("{s}", .{p.name}),
|
||||
+ .path => |p| print("--{}->", .{p.dist}),
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -255,7 +255,7 @@
|
||||
// dereference and optional value "unwrapping" look
|
||||
// together. Remember that you return the address with the
|
||||
// "&" operator.
|
||||
- if (place == entry.*.?.place) return entry;
|
||||
+ if (place == entry.*.?.place) return &entry.*.?;
|
||||
// Try to make your answer this long:__________;
|
||||
}
|
||||
return null;
|
||||
@@ -309,7 +309,7 @@
|
||||
//
|
||||
// Looks like the hermit forgot something in the return value of
|
||||
// this function. What could that be?
|
||||
- fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) void {
|
||||
+ fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) TripError!void {
|
||||
// We start at the destination entry.
|
||||
const destination_entry = self.getEntry(dest);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user