aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex McHugh <[email protected]>2024-06-23 20:24:28 +1200
committerAlex McHugh <[email protected]>2024-06-23 20:24:28 +1200
commitf656e950d57dcb3bca5a75ea63b40e5062a4037c (patch)
treeb45fcfaef061f356a8ed23140a0cf6af6233788f
parent3763f976eb4a6fb29cdab49a58b7554a9445faf2 (diff)
downloadziglings-f656e950d57dcb3bca5a75ea63b40e5062a4037c.tar.xz
ziglings-f656e950d57dcb3bca5a75ea63b40e5062a4037c.zip
Add patch.
-rw-r--r--patches/patches/046_optionals2.patch16
1 files changed, 8 insertions, 8 deletions
diff --git a/patches/patches/046_optionals2.patch b/patches/patches/046_optionals2.patch
index 164c0d6..9229f05 100644
--- a/patches/patches/046_optionals2.patch
+++ b/patches/patches/046_optionals2.patch
@@ -1,18 +1,18 @@
---- exercises/046_optionals2.zig 2024-05-10 23:11:25.796632478 +0200
-+++ answers/046_optionals2.zig 2024-05-10 23:10:16.115335668 +0200
-@@ -21,7 +21,7 @@
+--- exercises/046_optionals2.zig 2024-06-23 19:43:16
++++ answers/046_optionals2.zig 2024-06-23 19:42:46
+@@ -22,7 +22,7 @@
const Elephant = struct {
letter: u8,
- tail: *Elephant = null, // Hmm... tail needs something...
-+ tail: ?*Elephant = null, // <---- make this optional!
++ tail: ?*Elephant = null, // Hmm... tail needs something...
visited: bool = false,
};
-@@ -51,6 +51,6 @@
- // We should stop once we encounter a tail that
- // does NOT point to another element. What can
- // we put here to make that happen?
+@@ -66,6 +66,6 @@
+
+ // HINT: We want something similar to what `.?` does,
+ // but instead of ending the program, we want to exit the loop...
- e = e.tail ???
+ e = e.tail orelse break;
}