summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2024-09-04 18:59:51 +0000
committerChris Boesch <chrboesch@noreply.codeberg.org>2024-09-04 18:59:51 +0000
commitc9a98ad55550f6809c113981eb013f9aa2fac528 (patch)
tree763e19593357f511c9bdb98311b9323146a9457d
parentb0f859c62fbca3972bc3739593e7fed2f125e33a (diff)
parent49e0c32ec593397fb82c861a259ecd2aa43d12df (diff)
Merge pull request 'Reseted the simplification for de-referencing.' (#154) from i152 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/154
-rw-r--r--exercises/046_optionals2.zig2
-rw-r--r--patches/patches/046_optionals2.patch4
2 files changed, 3 insertions, 3 deletions
diff --git a/exercises/046_optionals2.zig b/exercises/046_optionals2.zig
index 86654f7..a5436d9 100644
--- a/exercises/046_optionals2.zig
+++ b/exercises/046_optionals2.zig
@@ -48,7 +48,7 @@ pub fn main() void {
// If e1 and e2 are valid pointers to elephants,
// this function links the elephants so that e1's tail "points" to e2.
fn linkElephants(e1: ?*Elephant, e2: ?*Elephant) void {
- e1.?.tail = e2;
+ e1.?.*.tail = e2.?;
}
// This function visits all elephants once, starting with the
diff --git a/patches/patches/046_optionals2.patch b/patches/patches/046_optionals2.patch
index 9229f05..1b364a6 100644
--- a/patches/patches/046_optionals2.patch
+++ b/patches/patches/046_optionals2.patch
@@ -1,5 +1,5 @@
---- exercises/046_optionals2.zig 2024-06-23 19:43:16
-+++ answers/046_optionals2.zig 2024-06-23 19:42:46
+--- exercises/046_optionals2.zig 2024-09-04 20:51:36.766783971 +0200
++++ answers/046_optionals2.zig 2024-09-04 20:51:01.389400985 +0200
@@ -22,7 +22,7 @@
const Elephant = struct {